[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1491801800-4371-1-git-send-email-mhjungk@gmail.com>
Date: Sun, 9 Apr 2017 22:23:20 -0700
From: Myungho Jung <mhjungk@...il.com>
To: chunkeey@...glemail.com
Cc: netdev@...r.kernel.org, Myungho Jung <mhjungk@...il.com>
Subject: [PATCH] p54: add null pointer check before releasing socket buffer
Kernel panic is caused by trying to dereference null pointer. Check if
the pointer is null before freeing space.
Signed-off-by: Myungho Jung <mhjungk@...il.com>
---
drivers/net/wireless/intersil/p54/txrx.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intersil/p54/txrx.c b/drivers/net/wireless/intersil/p54/txrx.c
index 1af7da0..8956061 100644
--- a/drivers/net/wireless/intersil/p54/txrx.c
+++ b/drivers/net/wireless/intersil/p54/txrx.c
@@ -503,7 +503,9 @@ static void p54_rx_eeprom_readback(struct p54_common *priv,
priv->eeprom = NULL;
tmp = p54_find_and_unlink_skb(priv, hdr->req_id);
- dev_kfree_skb_any(tmp);
+ if (unlikely(!tmp))
+ dev_kfree_skb_any(tmp);
+
complete(&priv->eeprom_comp);
}
@@ -597,7 +599,9 @@ static void p54_rx_stats(struct p54_common *priv, struct sk_buff *skb)
}
tmp = p54_find_and_unlink_skb(priv, hdr->req_id);
- dev_kfree_skb_any(tmp);
+ if (unlikely(!tmp))
+ dev_kfree_skb_any(tmp);
+
complete(&priv->stat_comp);
}
--
2.7.4
Powered by blists - more mailing lists