Skip to content

Commit

Permalink
mac802154: rx: add error handling after skb_clone
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Aring authored and Marcel Holtmann committed Oct 29, 2014
1 parent 20b4812 commit 05f7de6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions net/mac802154/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 05f7de6

Please sign in to comment.