batman-adv: Split a condition check
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 3 Nov 2015 18:20:34 +0000 (19:20 +0100)
committerAntonio Quartulli <a@unstable.cc>
Sat, 9 Jan 2016 12:56:00 +0000 (20:56 +0800)
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>
net/batman-adv/translation-table.c

index 5852fda9f1759f5d24f0781742c95f158fd0e849..a22080c53401403c50424cb6ff548d3292c1a826 100644 (file)
@@ -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);