diff options
author | Sven Eckelmann <sven.eckelmann@openmesh.com> | 2020-03-16 23:30:20 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-20 10:54:21 +0100 |
commit | f0455763b0f4140f18d7f83d88b048552bbc57c8 (patch) | |
tree | 25874f530acb16e6a9d6caa06ad52129d0a8a7ac /net | |
parent | 1c2139faa923dcdd75f58e68959422c8475fd58f (diff) | |
download | linux-stable-f0455763b0f4140f18d7f83d88b048552bbc57c8.tar.gz linux-stable-f0455763b0f4140f18d7f83d88b048552bbc57c8.tar.bz2 linux-stable-f0455763b0f4140f18d7f83d88b048552bbc57c8.zip |
batman-adv: Fix check of retrieved orig_gw in batadv_v_gw_is_eligible
commit 198a62ddffa4a4ffaeb741f642b7b52f2d91ae9b upstream.
The batadv_v_gw_is_eligible function already assumes that orig_node is not
NULL. But batadv_gw_node_get may have failed to find the originator. It
must therefore be checked whether the batadv_gw_node_get failed and not
whether orig_node is NULL to detect this error.
Fixes: 50164d8f500f ("batman-adv: B.A.T.M.A.N. V - implement GW selection logic")
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/bat_v.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c index f81e67fbb352..eb8cec14b854 100644 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -814,7 +814,7 @@ static bool batadv_v_gw_is_eligible(struct batadv_priv *bat_priv, } orig_gw = batadv_gw_node_get(bat_priv, orig_node); - if (!orig_node) + if (!orig_gw) goto out; if (batadv_v_gw_throughput_get(orig_gw, &orig_throughput) < 0) |