diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-10-15 12:38:00 +0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-10-15 22:26:43 +0400 |
commit | e086ed76671252d5b539854a83f8506be7bea05c (patch) | |
tree | 2ecb9bc3ef5b236cde08845b168f40d8c5075869 /drivers | |
parent | 00bfacfeb4a70053527b2b9ba2eb09ce0be0c1a4 (diff) | |
download | linux-e086ed76671252d5b539854a83f8506be7bea05c.tar.xz |
iio:buffer: Free active scan mask in iio_disable_all_buffers()
Usually the active scan mask is freed in __iio_update_buffers() when the buffer
is disabled. But when the device is still sampling when it is removed we'll end
up disabling the buffers in iio_disable_all_buffers(). So we also need to free
the active scan mask here, otherwise it will be leaked.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/industrialio-buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 2710f7245c3b..2db7dcd826b9 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -477,6 +477,9 @@ void iio_disable_all_buffers(struct iio_dev *indio_dev) indio_dev->currentmode = INDIO_DIRECT_MODE; if (indio_dev->setup_ops->postdisable) indio_dev->setup_ops->postdisable(indio_dev); + + if (indio_dev->available_scan_masks == NULL) + kfree(indio_dev->active_scan_mask); } int iio_update_buffers(struct iio_dev *indio_dev, |