diff options
author | Marek Lindner <mareklindner@neomailbox.ch> | 2014-04-23 15:44:25 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2014-05-15 14:03:16 -0400 |
commit | 16a4142363b11952d3aa76ac78004502c0c2fe6e (patch) | |
tree | 25f87cddc1fc4d1ac36fc28fe7f33959335d40e7 /net/batman-adv | |
parent | e84d2f8d2ae33c8215429824e1ecf24cbca9645e (diff) |
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 cb1c92ec37fb70543d133a1fa7d9b54d6f8a1ecd
("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>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/originator.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 1785da37b82c..6a484514cd3e 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -1079,7 +1079,8 @@ int batadv_orig_hardif_seq_print_text(struct seq_file *seq, void *offset) | |||
1079 | bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq, hard_iface); | 1079 | bat_priv->bat_algo_ops->bat_orig_print(bat_priv, seq, hard_iface); |
1080 | 1080 | ||
1081 | out: | 1081 | out: |
1082 | batadv_hardif_free_ref(hard_iface); | 1082 | if (hard_iface) |
1083 | batadv_hardif_free_ref(hard_iface); | ||
1083 | return 0; | 1084 | return 0; |
1084 | } | 1085 | } |
1085 | 1086 | ||