mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-11 15:49:56 +00:00
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>
This commit is contained in:
parent
20b48120c1
commit
05f7de6792
@ -240,14 +240,15 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
skb2 = skb_clone(skb, GFP_ATOMIC);
|
skb2 = skb_clone(skb, GFP_ATOMIC);
|
||||||
|
if (skb2) {
|
||||||
skb2->dev = sdata->dev;
|
skb2->dev = sdata->dev;
|
||||||
|
|
||||||
ieee802154_deliver_skb(skb2);
|
ieee802154_deliver_skb(skb2);
|
||||||
|
|
||||||
sdata->dev->stats.rx_packets++;
|
sdata->dev->stats.rx_packets++;
|
||||||
sdata->dev->stats.rx_bytes += skb->len;
|
sdata->dev->stats.rx_bytes += skb->len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb)
|
void ieee802154_rx(struct ieee802154_hw *hw, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user