diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-03-23 23:53:50 +0100 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2018-04-22 09:29:01 +0200 |
commit | 65cc02a8e1d4449daedf3a84e9dfdda2e44a5d97 (patch) | |
tree | 9daba2d821512ed4ee30bdd02986434383a639a0 | |
parent | Linux 4.17-rc1 (diff) | |
download | linux-65cc02a8e1d4449daedf3a84e9dfdda2e44a5d97.tar.xz linux-65cc02a8e1d4449daedf3a84e9dfdda2e44a5d97.zip |
batman-adv: don't pass a NULL hard_iface to batadv_hardif_put
In the case where hard_iface is NULL, the error path may pass a null
pointer to batadv_hardif_put causing a null pointer dereference error.
Avoid this by only calling the function if hard_iface not null.
Detected by CoverityScan, CID#1466456 ("Explicit null dereferenced")
Fixes: 53dd9a68ba68 ("batman-adv: add multicast flags netlink support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
-rw-r--r-- | net/batman-adv/multicast.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/batman-adv/multicast.c b/net/batman-adv/multicast.c index a11d3d89f012..a35f597e8c8b 100644 --- a/net/batman-adv/multicast.c +++ b/net/batman-adv/multicast.c @@ -1536,7 +1536,7 @@ out: if (!ret && primary_if) *primary_if = hard_iface; - else + else if (hard_iface) batadv_hardif_put(hard_iface); return ret; |