mac802154: fakelb: Fix potential NULL pointer dereference.
authorMartin Townsend <mtownsend1973@gmail.com>
Sun, 17 May 2015 19:44:54 +0000 (21:44 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 19 May 2015 09:44:44 +0000 (11:44 +0200)
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>
drivers/net/ieee802154/fakelb.c

index 91bbf030a443d95b263ee80f2417245088102096..230f7da021651d15e271a77aad1b128fe4b10ddb 100644 (file)
@@ -69,7 +69,8 @@ fakelb_hw_deliver(struct fakelb_dev_priv *priv, struct sk_buff *skb)
        spin_lock(&priv->lock);
        if (priv->working) {
                newskb = pskb_copy(skb, GFP_ATOMIC);
-               ieee802154_rx_irqsafe(priv->hw, newskb, 0xcc);
+               if (newskb)
+                       ieee802154_rx_irqsafe(priv->hw, newskb, 0xcc);
        }
        spin_unlock(&priv->lock);
 }