public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference
@ 2014-07-02  9:25 Emil Goode
  2014-07-02 16:33 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Emil Goode @ 2014-07-02  9:25 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rashika Kheria, Valentina Manea,
	Josh Triplett, Andrea Merello
  Cc: devel, linux-kernel, kernel-janitors, Emil Goode

We need to make sure the struct rtllib_device pointer ieee is not NULL
after the goto rx_dropped label since it is dereferenced there.

Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
 drivers/staging/rtl8192e/rtllib_rx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 60de54c..7db3e74 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1496,7 +1496,8 @@ int rtllib_rx(struct rtllib_device *ieee, struct sk_buff *skb,
 	return ret;
 
  rx_dropped:
-	ieee->stats.rx_dropped++;
+	if (ieee)
+		ieee->stats.rx_dropped++;
 	return 0;
 }
 EXPORT_SYMBOL(rtllib_rx);
-- 
1.7.10.4


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

end of thread, other threads:[~2014-07-02 17:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02  9:25 [PATCH] Staging: rtl8192e: Fix potential NULL pointer dereference Emil Goode
2014-07-02 16:33 ` Greg Kroah-Hartman
2014-07-02 17:26   ` Emil Goode
2014-07-02 17:32     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox