From 05f7de67921d8b382b14597c3955c5881d804d99 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Wed, 29 Oct 2014 21:34:42 +0100 Subject: [PATCH] mac802154: rx: add error handling after skb_clone This patch adds error handling after skb_clone and deliver only if skb_clone was successful. Signed-off-by: Alexander Aring Signed-off-by: Marcel Holtmann --- net/mac802154/rx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c index 971a8553e9b6..95961cccc253 100644 --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c @@ -240,12 +240,13 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) continue; skb2 = skb_clone(skb, GFP_ATOMIC); - skb2->dev = sdata->dev; + if (skb2) { + skb2->dev = sdata->dev; + ieee802154_deliver_skb(skb2); - ieee802154_deliver_skb(skb2); - - sdata->dev->stats.rx_packets++; - sdata->dev->stats.rx_bytes += skb->len; + sdata->dev->stats.rx_packets++; + sdata->dev->stats.rx_bytes += skb->len; + } } } -- 2.20.1