OSDN Git Service

iio: hmc5843: fix potential NULL pointer dereferences
authorKangjie Lu <kjlu@umn.edu>
Sat, 16 Mar 2019 22:08:33 +0000 (17:08 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 4 Apr 2019 19:20:14 +0000 (20:20 +0100)
commit536cc27deade8f1ec3c1beefa60d5fbe0f6fcb28
tree6d6532e79caa87ca9b69f9f15a8032ca222df5bb
parenta816646f08ce18e8787d241e1dbda5cbc314e5ea
iio: hmc5843: fix potential NULL pointer dereferences

devm_regmap_init_i2c may fail and return NULL. The fix returns
the error when it fails.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/magnetometer/hmc5843_i2c.c
drivers/iio/magnetometer/hmc5843_spi.c