public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] staging: rtl8192u: r8192U_core: Fix for possible null pointer dereference
@ 2015-01-29 18:59 Rickard Strandqvist
  2015-02-02 16:51 ` Sudip Mukherjee
  2015-02-05 12:27 ` Dan Carpenter
  0 siblings, 2 replies; 9+ messages in thread
From: Rickard Strandqvist @ 2015-01-29 18:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Peter P Waskiewicz Jr
  Cc: Rickard Strandqvist, Antoine Schweitzer-Chaput, Ana Rey,
	Chaitanya Hazarey, Koray Gulcu, Greg Donald, devel, linux-kernel

Fix a possible null pointer dereference, there is
otherwise a risk of a possible null pointer dereference.

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/rtl8192u/r8192U_core.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index e031a25..4a29237 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -4476,11 +4476,11 @@ static void query_rxdesc_status(struct sk_buff *skb,
 
 	/* for debug 2008.5.29 */
 
-	//added by vivi, for MP, 20080108
-	stats->RxIs40MHzPacket = driver_info->BW;
-	if (stats->RxDrvInfoSize != 0)
+	if (driver_info && stats->RxDrvInfoSize != 0) {
+		//added by vivi, for MP, 20080108
+		stats->RxIs40MHzPacket = driver_info->BW;
 		TranslateRxSignalStuff819xUsb(skb, stats, driver_info);
-
+	}
 }
 
 static void rtl8192_rx_nomal(struct sk_buff *skb)
-- 
1.7.10.4


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

end of thread, other threads:[~2015-02-07 13:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-29 18:59 [PATCH v2] staging: rtl8192u: r8192U_core: Fix for possible null pointer dereference Rickard Strandqvist
2015-02-02 16:51 ` Sudip Mukherjee
2015-02-04 20:05   ` Rickard Strandqvist
2015-02-05 12:27 ` Dan Carpenter
2015-02-05 12:43   ` Sudip Mukherjee
2015-02-05 12:51     ` Dan Carpenter
2015-02-05 17:39       ` Rickard Strandqvist
2015-02-06 14:32         ` Sudip Mukherjee
2015-02-07 13:04           ` Rickard Strandqvist

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