diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-29 16:34:42 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-29 18:07:46 -0400 |
commit | 05f7de67921d8b382b14597c3955c5881d804d99 (patch) | |
tree | fba5d076b382adab64c99e08c07a930822b8a62e /net | |
parent | 20b48120c14fb4bf6ebe4ed4cfa1b828e5e1dff8 (diff) |
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')
-rw-r--r-- | net/mac802154/rx.c | 11 |
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) | |||
240 | continue; | 240 | continue; |
241 | 241 | ||
242 | skb2 = skb_clone(skb, GFP_ATOMIC); | 242 | skb2 = skb_clone(skb, GFP_ATOMIC); |
243 | skb2->dev = sdata->dev; | 243 | if (skb2) { |
244 | skb2->dev = sdata->dev; | ||
245 | ieee802154_deliver_skb(skb2); | ||
244 | 246 | ||
245 | ieee802154_deliver_skb(skb2); | 247 | sdata->dev->stats.rx_packets++; |
246 | 248 | sdata->dev->stats.rx_bytes += skb->len; | |
247 | sdata->dev->stats.rx_packets++; | 249 | } |
248 | sdata->dev->stats.rx_bytes += skb->len; | ||
249 | } | 250 | } |
250 | } | 251 | } |
251 | 252 | ||