]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: hmc5843: fix potential NULL pointer dereferences
authorKangjie Lu <kjlu@umn.edu>
Sat, 16 Mar 2019 22:08:33 +0000 (17:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:43:38 +0000 (06:43 -0700)
commitf899898e265ae5de7b709e1aea1c28542d2a1300
treec7fd44f5058906add168e58588d67b8cf527a328
parent5e526a75033d02e7cf0bf964d21b58a6105a66d3
iio: hmc5843: fix potential NULL pointer dereferences

[ Upstream commit 536cc27deade8f1ec3c1beefa60d5fbe0f6fcb28 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/magnetometer/hmc5843_i2c.c
drivers/iio/magnetometer/hmc5843_spi.c