iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe()
authorChuhong Yuan <hslester96@gmail.com>
Thu, 28 May 2020 06:41:21 +0000 (14:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:03 +0000 (09:34 +0200)
commit8bc16a4690ba12c32216792d32aba464bb8716da
tree5fa2ed02cf8785be77e25790b6a843f401d7c870
parent4f96f95beb442e31a295fc7eec8adf204650ec32
iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe()

commit d7369ae1f4d7cffa7574d15e1f787dcca184c49d upstream.

The function iio_device_register() was called in mma8452_probe().
But the function iio_device_unregister() was not called after
a call of the function mma8452_set_freefall_mode() failed.
Thus add the missed function call for one error case.

Fixes: 1a965d405fc6 ("drivers:iio:accel:mma8452: added cleanup provision in case of failure.")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/accel/mma8452.c