summaryrefslogtreecommitdiff
path: root/net/mac802154/rx.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-29 23:34:42 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-10-30 01:07:46 +0300
commit05f7de67921d8b382b14597c3955c5881d804d99 (patch)
treefba5d076b382adab64c99e08c07a930822b8a62e /net/mac802154/rx.c
parent20b48120c14fb4bf6ebe4ed4cfa1b828e5e1dff8 (diff)
downloadlinux-05f7de67921d8b382b14597c3955c5881d804d99.tar.xz
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 <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/rx.c')
-rw-r--r--net/mac802154/rx.c11
1 files 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;
+ }
}
}