Re: [PATCH] iio: adxl345: move null check for i2c id at start of probe

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

 



On Tue, Aug 07, 2018 at 05:06:05PM +0300, Alexandru Ardelean wrote:
> Fixes ef89f4b96a2 ("iio: adxl345: Add support for the ADXL375").
> 
> This was found via static checker.
> After looking into the code a bit, it's unlikely that there will be a NULL
> dereference if the `id` object in that specific code path.
> However, it's safe to add a NULL (paranoid) check just to make sure and
> remove any uncertainties.

I would like to know when would that case happen actually ?

Because probe will only be called only when a match occurs either
through DT or id matching. Isn't it ?

-- 
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux