lkml.org 
[lkml]   [2014]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] staging: vt6655: wmgr.c: Fix for possible null pointer dereference
Hi

Ok, if you want, otherwise we can put it after the NULL check?

Kind regards
Rickard Strandqvist


2014-12-14 23:52 GMT+01:00 Joe Perches <joe@perches.com>:
> On Sun, 2014-12-14 at 23:42 +0100, Rickard Strandqvist wrote:
>> There is otherwise a risk of a possible null pointer dereference.
>> Was largely found by using a static code analysis program called cppcheck.
> []
>> diff --git 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));
>
> This is a function tracing printk.
> I think it's better to just remove it.
>
>
>


\
 
 \ /
  Last update: 2014-12-15 00:41    [W:0.052 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site