batman-adv: Avoid nullptr dereference in bla after vlan_insert_tag
authorSven Eckelmann <sven@narfation.org>
Tue, 17 Mar 2020 23:27:02 +0000 (00:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 08:06:27 +0000 (09:06 +0100)
commite1aba83cb0d0ad17fc81c075787e55d20b31edf5
treeae99ca4ade722b65a610f310823e54437b72647d
parent8227e1b64b34b6e28d6d92ee865c471ffd25721d
batman-adv: Avoid nullptr dereference in bla after vlan_insert_tag

commit 10c78f5854d361ded4736c1831948e0a5f67b932 upstream.

vlan_insert_tag can return NULL on errors. The bridge loop avoidance code
therefore has to check the return value of vlan_insert_tag for NULL before
it can safely operate on this pointer.

Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/batman-adv/bridge_loop_avoidance.c