Commit e087f34f authored by Markus Elfring's avatar Markus Elfring Committed by Antonio Quartulli

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: default avatarAntonio Quartulli <a@unstable.cc>
parent f75a33ae
...@@ -3339,7 +3339,10 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst, ...@@ -3339,7 +3339,10 @@ bool batadv_is_ap_isolated(struct batadv_priv *bat_priv, u8 *src, u8 *dst,
bool ret = false; bool ret = false;
vlan = batadv_softif_vlan_get(bat_priv, vid); 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; goto out;
tt_local_entry = batadv_tt_local_hash_find(bat_priv, dst, vid); tt_local_entry = batadv_tt_local_hash_find(bat_priv, dst, vid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment