From: Alexander Aring Date: Wed, 29 Oct 2014 20:34:42 +0000 (+0100) Subject: mac802154: rx: add error handling after skb_clone X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=05f7de67921d8b382b14597c3955c5881d804d99;p=linux-beck.git 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 --- 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; + } } }