Re: [PATCH] iio: hmc5843_spi: fix a NULL pointer dereference

2019-03-10 Thread Jonathan Cameron
On Sat, 9 Mar 2019 12:56:27 -0600 Kangjie Lu wrote: > In case devm_regmap_init_spi fails and returns NULL, the fix > returns an error to avoid NULL pointer dereference > > Signed-off-by: Kangjie Lu Hi. The fix is good, but please do the same for the i2c element of the driver. I'd like them b

[PATCH] iio: hmc5843_spi: fix a NULL pointer dereference

2019-03-09 Thread Kangjie Lu
In case devm_regmap_init_spi fails and returns NULL, the fix returns an error to avoid NULL pointer dereference Signed-off-by: Kangjie Lu --- drivers/iio/magnetometer/hmc5843_spi.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/hmc5843_spi.c