From: Eric Dumazet <eduma...@google.com>

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

Fixes: 93f93a440415 ("net: move skb_mark_napi_id() into core networking stack")
Signed-off-by: Eric Dumazet <eduma...@google.com>
---
 net/core/dev.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 
41cef3e3f558b857a9093a83f6b0c73f32b8b45f..5df6cbce727c140684b84129c26ffc0606260cbb
 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4390,8 +4390,10 @@ struct sk_buff *napi_get_frags(struct napi_struct *napi)
 
        if (!skb) {
                skb = napi_alloc_skb(napi, GRO_MAX_HEAD);
-               napi->skb = skb;
-               skb_mark_napi_id(skb, napi);
+               if (skb) {
+                       napi->skb = skb;
+                       skb_mark_napi_id(skb, napi);
+               }
        }
        return skb;
 }


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to