Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2f9dc3b authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: avoid NULL deref in napi_get_frags()



napi_alloc_skb() can return NULL.
We should not crash should this happen.

Fixes: 93f93a44 ("net: move skb_mark_napi_id() into core networking stack")
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b3d39a88
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4390,9 +4390,11 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)

	if (!skb) {
		skb = napi_alloc_skb(napi, GRO_MAX_HEAD);
		if (skb) {
			napi->skb = skb;
			skb_mark_napi_id(skb, napi);
		}
	}
	return skb;
}
EXPORT_SYMBOL(napi_get_frags);