提交 e2f9dc3b 编写于 作者: E Eric Dumazet 提交者: David S. Miller

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: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b3d39a88
...@@ -4390,8 +4390,10 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi) ...@@ -4390,8 +4390,10 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)
if (!skb) { if (!skb) {
skb = napi_alloc_skb(napi, GRO_MAX_HEAD); skb = napi_alloc_skb(napi, GRO_MAX_HEAD);
napi->skb = skb; if (skb) {
skb_mark_napi_id(skb, napi); napi->skb = skb;
skb_mark_napi_id(skb, napi);
}
} }
return skb; return skb;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册