lkml.org 
[lkml]   [2014]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] scsi: pm8001: pm8001_hwi.c: Fix for possible null pointer dereference
From
Hi

Quite rightly, this is what cppcheck reacts.
Ok, I'll send a patch for that instead then.


Best regards
Rickard Strandqvist


2014-05-28 13:38 GMT+02:00 Tomas Henzl <thenzl@redhat.com>:
> On 05/28/2014 01:28 PM, Christoph Hellwig wrote:
>> On Sun, May 18, 2014 at 06:14:00PM +0200, 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.
>> I can't see how dev->lldd_dev would be NULL here.
>
> The analysis program likely can't know that, the reason for this report
> it that dev->lldd_dev is tested for not being null several lines below -
> http://lxr.free-electrons.com/source/drivers/scsi/pm8001/pm8001_hwi.c#L4447
> So the other option is to remove this^ test.
>


\
 
 \ /
  Last update: 2014-05-30 01:21    [W:0.030 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site