mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
batman-adv: fix indirect hard_iface NULL dereference
If hard_iface is NULL and goto out is made batadv_hardif_free_ref()
doesn't check for NULL before dereferencing it to get to refcount.
Introduced in cb1c92ec37
("batman-adv: add debugfs support to view multiif tables").
Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Acked-by: Antonio Quartulli <antonio@meshcoding.com>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
This commit is contained in:
parent
e84d2f8d2a
commit
16a4142363
1 changed files with 2 additions and 1 deletions
|
@ -1079,7 +1079,8 @@ int batadv_orig_hardif_seq_print_text(struct seq_file *seq, void *offset)
|
|||
bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq, hard_iface);
|
||||
|
||||
out:
|
||||
batadv_hardif_free_ref(hard_iface);
|
||||
if (hard_iface)
|
||||
batadv_hardif_free_ref(hard_iface);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue