summaryrefslogtreecommitdiffstats
path: root/net/mac802154/rx.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-10-29 21:34:42 +0100
committerMarcel Holtmann <marcel@holtmann.org>2014-10-29 23:07:46 +0100
commit05f7de67921d8b382b14597c3955c5881d804d99 (patch)
treefba5d076b382adab64c99e08c07a930822b8a62e /net/mac802154/rx.c
parentmac802154: rx: monitor receive cleanup (diff)
downloadlinux-05f7de67921d8b382b14597c3955c5881d804d99.tar.xz
linux-05f7de67921d8b382b14597c3955c5881d804d99.zip
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;
+ }
}
}