diff options
author | Martin Townsend <mtownsend1973@gmail.com> | 2015-05-17 15:44:54 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-05-19 05:44:44 -0400 |
commit | cb97d9a3eb0be1e33db5535955e6629e800f3f0e (patch) | |
tree | c7e2d8dc1780050d86d821960f22cdd69a6af4ec /drivers/net | |
parent | 0e66545701014814360b08a7a43ca652f82b6e5a (diff) |
mac802154: fakelb: Fix potential NULL pointer dereference.
fakelb_hw_deliver creates a copy of the skb's header which can
potentially return NULL so we now check for this before actually
delivering to the 802.15.4 MAC layer.
Signed-off-by: Martin Townsend <martin.townsend@xsilon.com>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ieee802154/fakelb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c index 91bbf030a443..230f7da02165 100644 --- a/drivers/net/ieee802154/fakelb.c +++ b/drivers/net/ieee802154/fakelb.c | |||
@@ -69,7 +69,8 @@ fakelb_hw_deliver(struct fakelb_dev_priv *priv, struct sk_buff *skb) | |||
69 | spin_lock(&priv->lock); | 69 | spin_lock(&priv->lock); |
70 | if (priv->working) { | 70 | if (priv->working) { |
71 | newskb = pskb_copy(skb, GFP_ATOMIC); | 71 | newskb = pskb_copy(skb, GFP_ATOMIC); |
72 | ieee802154_rx_irqsafe(priv->hw, newskb, 0xcc); | 72 | if (newskb) |
73 | ieee802154_rx_irqsafe(priv->hw, newskb, 0xcc); | ||
73 | } | 74 | } |
74 | spin_unlock(&priv->lock); | 75 | spin_unlock(&priv->lock); |
75 | } | 76 | } |