On 10/15/13 09:38, Lars-Peter Clausen wrote: > 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@xxxxxxxxxx> Good spot. Applied to the togreg branch of iio.git Thanks, Jonathan > --- > drivers/iio/industrialio-buffer.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c > index 796376a..1c72080 100644 > --- a/drivers/iio/industrialio-buffer.c > +++ b/drivers/iio/industrialio-buffer.c > @@ -490,6 +490,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); > } > > static int __iio_update_buffers(struct iio_dev *indio_dev, > -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html