mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: vt6655: wmgr.c:  Fix for possible null pointer dereference
@ 2014-12-14 22:42 Rickard Strandqvist
  2014-12-14 22:52 ` Joe Perches
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-12-14 22:42 UTC (permalink / raw)
  To: Forest Bond, Greg Kroah-Hartman
  Cc: Rickard Strandqvist, Malcolm Priestley, Guillaume Clement,
	Guido Martínez, Paul E. McKenney, Himangi Saraogi,
	Joe Perches, devel, linux-kernel

There is otherwise a risk of a possible null pointer dereference.

Was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/staging/vt6655/wmgr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c
index c73c39d..f98935c 100644
--- a/drivers/staging/vt6655/wmgr.c
+++ b/drivers/staging/vt6655/wmgr.c
@@ -4391,7 +4391,7 @@ bAdd_PMKID_Candidate(
 	unsigned int ii = 0;
 
 	pr_debug("bAdd_PMKID_Candidate START: (%d)\n",
-		 (int)pDevice->gsPMKIDCandidate.NumCandidates);
+		(int)(pDevice ? pDevice->gsPMKIDCandidate.NumCandidates : 0));
 
 	if ((pDevice == NULL) || (pbyBSSID == NULL) || (psRSNCapObj == NULL))
 		return false;
-- 
1.7.10.4


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

end of thread, other threads:[~2014-12-14 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-14 22:42 [PATCH] staging: vt6655: wmgr.c: Fix for possible null pointer dereference Rickard Strandqvist
2014-12-14 22:52 ` Joe Perches
2014-12-14 22:55   ` Rickard Strandqvist

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

all inboxes | Powered by JetHome®