Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1261890
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/3] batman-adv: Split a condition check |
| Date | 2015-11-03 22:00 +0100 |
| Message-ID | <qqQQp-7KR-11@gated-at.bofh.it> (permalink) |
| References | (13 earlier) <mSsDN-4wa-61@gated-at.bofh.it> <mSsDN-4wa-63@gated-at.bofh.it> <mSsDN-4wa-65@gated-at.bofh.it> <mSsDN-4wa-33@gated-at.bofh.it> <qqQGJ-7Hz-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 3 Nov 2015 20:41:02 +0100 Let us split a check for a condition at the beginning of the batadv_is_ap_isolated() function so that a direct return can be performed in this function if the variable "vlan" contained a null pointer. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- net/batman-adv/translation-table.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 48315de..965a004 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -3319,7 +3319,10 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst, bool ret = false; vlan = batadv_softif_vlan_get(bat_priv, vid); - if (!vlan || !atomic_read(&vlan->ap_isolation)) + if (!vlan) + return false; + + if (!atomic_read(&vlan->ap_isolation)) goto out; tt_local_entry = batadv_tt_local_hash_find(bat_priv, dst, vid); -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] batman-adv: Deletion of a few unnecessary checks SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-03 21:50 +0100 [PATCH 3/3] batman-adv: Less function calls in batadv_is_ap_isolated() after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-03 22:00 +0100 [PATCH 2/3] batman-adv: Split a condition check SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-03 22:00 +0100 [PATCH 1/3] batman-adv: Delete an unnecessary check before the function call "batadv_softif_vlan_free_ref" SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-03 22:00 +0100
csiph-web