batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_d...
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 2 Jan 2024 06:27:45 +0000 (07:27 +0100)
committerSimon Wunderlich <sw@simonwunderlich.de>
Sat, 27 Jan 2024 08:13:59 +0000 (09:13 +0100)
commitffc15626c861f811f9778914be004fcf43810a91
tree6652cbf166a402500d9673c61e05aca0a0c1eb27
parentdf3fc228dead6298ac9e985a270b8521e41471e6
batman-adv: Return directly after a failed batadv_dat_select_candidates() in batadv_dat_forward_data()

The kfree() function was called in one case by
the batadv_dat_forward_data() function during error handling
even if the passed variable contained a null pointer.
This issue was detected by using the Coccinelle software.

* Thus return directly after a batadv_dat_select_candidates() call failed
  at the beginning.

* Delete the label “out” which became unnecessary with this refactoring.

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/distributed-arp-table.c