batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
PATCH 1/1 batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
batadv_orig_ifinfo_new() returns NULL only when its GFP_ATOMIC allocation fails, which is a normal runtime condition and not a bug. batadv_v_ogm_forward() already handles this the same way, simply checking for NULL without a WARN_ON.
Do the same in batadv_iv_ogm_update_seqnos() to avoid a spurious WARN_ON splat when the allocation fails (e.g. under fault injection).
Fixes 7351a4822d42 ("batman-adv: split out router from orig_node")
Reported-by [email protected]
Signed-off-by Deepanshu Kartikey <[email protected]>
--- net/batman-adv/bat_iv_ogm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/bat_iv_ogm.c +1 -1
@@ -1410,7 +1410,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,return BATADV_NO_DUP ; orig_ifinfo =batadv_orig_ifinfo_new (orig_node, if_outgoing); -if (WARN_ON (!orig_ifinfo)) { +if (!orig_ifinfo) {batadv_orig_node_put (orig_node);return 0 ; }
Signature · 1 line
2.43.0
Quoted 1 line · Deepanshu Kartikey
batman-adv: avoid
WARN_ONfororig_ifinfoallocation failure
Applied, thanks!
[1/1] batman-adv: avoid WARN_ON for orig_ifinfo allocation failure
https://git.open-mesh.org/batadv/c/abfe281aeab4
Best regards,
Signature · 1 line
Sven Eckelmann <[email protected]>