lkml.org 
[lkml]   [2019]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][V2][next] regulator: axp20x: check rdev is null before dereferencing it
On Tue, Feb 05, 2019 at 11:37:40AM +0800, Chen-Yu Tsai wrote:
> On Sat, Dec 22, 2018 at 7:32 PM Colin King <colin.king@canonical.com> wrote:
> >
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently rdev is dereferenced when assigning desc before rdev is null
> > checked, hence there is a potential null pointer dereference on rdev.
> > Fix this by null checking rdev first.
> >
> > Detected by CoverityScan, CID#1476031 ("Dereference before null check")
> >
> > Fixes: 77e3e3b165db ("regulator: axp20x: add software based soft_start for AXP209 LDO3")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> This patch somehow fell through the cracks. Sorry about that.
>
> Both are really false positives.

I don't like when people use the word "false positive" like this. The
code doesn't checks for NULL after a dereference so that's a nonsense
to do. The correct thing is to remove the NULL check.

regards,
dan carpenter

\
 
 \ /
  Last update: 2019-02-15 08:48    [W:0.101 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site