mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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: 53dd9a68ba
("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>
This commit is contained in:
parent
60cc43fc88
commit
65cc02a8e1
1 changed files with 1 additions and 1 deletions
|
@ -1536,7 +1536,7 @@ batadv_mcast_netlink_get_primary(struct netlink_callback *cb,
|
|||
|
||||
if (!ret && primary_if)
|
||||
*primary_if = hard_iface;
|
||||
else
|
||||
else if (hard_iface)
|
||||
batadv_hardif_put(hard_iface);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue