lkml.org 
[lkml]   [2018]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][next] media: ispstat: don't dereference user_cfg before a null check
From
Date
Hi Sakari,

On 04/30/2018 10:15 AM, Sakari Ailus wrote:
>> Isn't there a guarantee that new_buf won't be NULL ? The new_buf pointer comes
>> from the parg variable in video_usercopy(), which should always point to a
>> valid buffer given that the ioctl number specifies a non-zero size.
>
> Fair question. After looking at the code, I agree with you; there should be
> no reason to perform the check in the first place. It may have been that
> the function has been used differently in the past but the check should be
> rather removed now.
>
> I'll drop the patch.
>

Please, if the check isn't needed anymore, make sure it is removed.

This helps to reduce the number of false positives reported by static
analyzers.

Thanks
--
Gustavo

\
 
 \ /
  Last update: 2018-04-30 17:27    [W:0.070 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site