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

commit 60154a1e0495ffb8343a95cefe1e874634572fa8 upstream.

vlan_insert_tag can return NULL on errors. The distributed arp table code
therefore has to check the return value of vlan_insert_tag for NULL before
it can safely operate on this pointer.

Fixes: be1db4f6615b ("batman-adv: make the Distributed ARP Table vlan aware")
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/distributed-arp-table.c