Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
commit b1199c6da8365996cc96d59133b04add9346192e Author: Markus Elfring elfring@users.sourceforge.net Date: Tue Nov 3 20:41:02 2015 +0100
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
b1199c6da8365996cc96d59133b04add9346192e 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 42c9747..1ca8831 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -3365,7 +3365,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);