From d2fffd6c2fd60fe9ab63ef30758d9d43a5057549 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Fri, 14 Oct 2011 14:46:58 +0100 Subject: staging:iio: fix removal path to allow correct freeing. Fix a dumb lack of consideration of the effect of combining the iio_device_unregister and iio_free_device calls into one. There is no valid place to free some of the sysfs array elements. Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/staging/iio/imu/adis16400_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/staging/iio/imu') diff --git a/drivers/staging/iio/imu/adis16400_core.c b/drivers/staging/iio/imu/adis16400_core.c index 365f99ae86e..d082a37c4fb 100644 --- a/drivers/staging/iio/imu/adis16400_core.c +++ b/drivers/staging/iio/imu/adis16400_core.c @@ -1088,6 +1088,7 @@ static int adis16400_remove(struct spi_device *spi) int ret; struct iio_dev *indio_dev = spi_get_drvdata(spi); + iio_device_unregister(indio_dev); ret = adis16400_stop_device(indio_dev); if (ret) goto err_ret; @@ -1095,7 +1096,7 @@ static int adis16400_remove(struct spi_device *spi) adis16400_remove_trigger(indio_dev); iio_buffer_unregister(indio_dev); adis16400_unconfigure_ring(indio_dev); - iio_device_unregister(indio_dev); + iio_free_device(indio_dev); return 0; -- cgit v1.2.3-70-g09d2