lkml.org 
[lkml]   [2018]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: rts5208: add check on NULL before dereference
On 2018-06-09 15:34, Andy Shevchenko wrote:
> On Sat, Jun 9, 2018 at 7:58 PM, <okaya@codeaurora.org> wrote:
>> On 2018-06-09 12:38, Anton Vasilyev wrote:
>>>
>>> If rtsx_probe fails to allocate dev->chip, then NULL pointer
>>> dereference occurs at rtsx_release_resources().
>>>
>>> Patch adds checks chip on NULL before its dereference at
>>> rtsx_release_resources and passing with dereference inside
>>> rtsx_release_chip.
>>>
>>> Found by Linux Driver Verification project (linuxtesting.org).
>
>> I think you should bail out if dev->chip is null rather than adding
>> conditiinals.
>
> I'm wondering if it's false positive. At which circumstances that may
> happen?

Only if dev->chip allocation fails. Code tries to cleanup prior
resources by calling clean_everything() function which ends up in
rtsx_release_resources()

\
 
 \ /
  Last update: 2018-06-10 00:23    [W:0.072 / U:7.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site