batman-adv: Improve exception handling in batadv_throw_uevent()
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 2 Jan 2024 06:52:21 +0000 (07:52 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sat, 27 Jan 2024 08:13:59 +0000 (09:13 +0100)
commit5593e9abf1cf2bf096366d8c7fd933bc69d561ce
tree4ff69ffdf3dabdd2b7cdfd5e00c2255ca16ab199
parentffc15626c861f811f9778914be004fcf43810a91
batman-adv: Improve exception handling in batadv_throw_uevent()

The kfree() function was called in up to three cases by
the batadv_throw_uevent() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

* Thus adjust jump targets.

* Reorder kfree() calls at the end.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
net/batman-adv/main.c