Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb97d9a3 authored by Martin Townsend's avatar Martin Townsend Committed by Marcel Holtmann
Browse files

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: default avatarMartin Townsend <martin.townsend@xsilon.com>
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 0e665457
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ 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);
		if (newskb)
			ieee802154_rx_irqsafe(priv->hw, newskb, 0xcc);
	}
	spin_unlock(&priv->lock);