linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 bluetooth-next] mac802154: fakelb: Fix potential NULL pointer dereference.
@ 2015-05-08  8:57 Martin Townsend
  2015-05-08  9:40 ` Alexander Aring
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Townsend @ 2015-05-08  8:57 UTC (permalink / raw)
  To: alex.aring; +Cc: linux-wpan, linux-bluetooth, Martin Townsend

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>
---
 drivers/net/ieee802154/fakelb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index dc2bfb6..baa8d36 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)
 	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);
 }
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-08 10:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08  8:57 [PATCHv2 bluetooth-next] mac802154: fakelb: Fix potential NULL pointer dereference Martin Townsend
2015-05-08  9:40 ` Alexander Aring
2015-05-08  9:51   ` Alexander Aring
2015-05-08 10:19     ` Alexander Aring
2015-05-08 10:22     ` Martin Townsend

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).