Skip to content
Commit 6b8471e4 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron
Browse files

iio: adxl345: move null check for i2c id at start of probe

Fixes ef89f4b9

 ("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.

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent eb2e1888
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment