summaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-11-03 19:20:34 +0100
committerAntonio Quartulli <a@unstable.cc>2016-01-09 13:56:00 +0100
commite087f34f28d8597f7c82f079337939367ba96537 (patch)
treef20ea1d8ed246002f14679e52b6af534f2fe9aad /net/batman-adv
parentbatman-adv: Delete an unnecessary check before the function call "batadv_soft... (diff)
downloadlinux-e087f34f28d8597f7c82f079337939367ba96537.tar.xz
linux-e087f34f28d8597f7c82f079337939367ba96537.zip
batman-adv: Split a condition check
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> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/translation-table.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 5852fda9f175..a22080c53401 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -3339,7 +3339,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);