Commit 16a41423 authored by Marek Lindner's avatar Marek Lindner Committed by Antonio Quartulli

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 cb1c92ec
("batman-adv: add debugfs support to view multiif tables").
Reported-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
Acked-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
Signed-off-by: default avatarAntonio Quartulli <antonio@meshcoding.com>
parent e84d2f8d
......@@ -1079,6 +1079,7 @@ 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:
if (hard_iface)
batadv_hardif_free_ref(hard_iface);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment