Re: [PATCH][V2][next] regulator: axp20x: check rdev is null before dereferencing it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> wrote:
> >
> > From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> >
> > 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@xxxxxxxxxxxxx>
> 
> 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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux