]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: Avoid nullptr derefence in batadv_v_neigh_is_sob
authorSven Eckelmann <sven@narfation.org>
Fri, 6 May 2016 09:43:38 +0000 (11:43 +0200)
committerAntonio Quartulli <a@unstable.cc>
Wed, 18 May 2016 03:49:39 +0000 (11:49 +0800)
commitb4deb8bc8a06a6e6d7894afab61381324ef35e22
treef397605a50fac1cb444e9f3f7083defbbcfbc18d
parent786e0c1633c1bb5f8f7bcd1457e5dcf268a1f55b
batman-adv: Avoid nullptr derefence in batadv_v_neigh_is_sob

batadv_neigh_ifinfo_get can return NULL when it cannot find (even when only
temporarily) anymore the neigh_ifinfo in the list neigh->ifinfo_list. This
has to be checked to avoid kernel Oopses when the ifinfo is dereferenced.

This a situation which isn't expected but is already handled by functions
like batadv_v_neigh_cmp. The same kind of warning is therefore used before
the function returns without dereferencing the pointers.

Fixes: 393cef320de7 ("batman-adv: B.A.T.M.A.N. V - implement neighbor comparison API calls")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
net/batman-adv/bat_v.c