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>
This commit is contained in:
Kangjie Lu 2019-03-16 17:08:33 -05:00 • committed by Jonathan Cameron
commit 536cc27dea
2 changed files with 12 additions and 2 deletions