Skip to content

Commit

Permalink
batman-adv: Split a condition check
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Marek Lindner <[email protected]>
Signed-off-by: Antonio Quartulli <[email protected]>
  • Loading branch information
elfring authored and ordex committed Jan 9, 2016
1 parent f75a33a commit e087f34
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e087f34

Please sign in to comment.