提交 05f7de67 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

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: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 20b48120
...@@ -240,12 +240,13 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) ...@@ -240,12 +240,13 @@ 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);
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;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册