Since commit 9e69c9 ("iio: Add reference counting for buffers") the iio core frees the buffer. So if the driver does it as well then bad things will happen. Cc: Lars-Peter Clausen <lars@xxxxxxxxxx> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> --- v1…v2: make it compile after removal of error_kfifo_free label. Grml. I tested it before I removed the same thing from tiadc_iio_buffered_hardware_setup() drivers/iio/adc/ti_am335x_adc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index f974dea..4f6e0ce 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -239,7 +239,7 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev, ret = request_threaded_irq(irq, pollfunc_th, pollfunc_bh, flags, indio_dev->name, indio_dev); if (ret) - goto error_kfifo_free; + return ret; indio_dev->setup_ops = setup_ops; indio_dev->modes |= INDIO_BUFFER_HARDWARE; @@ -254,8 +254,6 @@ static int tiadc_iio_buffered_hardware_setup(struct iio_dev *indio_dev, error_free_irq: free_irq(irq, indio_dev); -error_kfifo_free: - iio_kfifo_free(indio_dev->buffer); return ret; } @@ -264,7 +262,6 @@ static void tiadc_iio_buffered_hardware_remove(struct iio_dev *indio_dev) struct tiadc_device *adc_dev = iio_priv(indio_dev); free_irq(adc_dev->mfd_tscadc->irq, indio_dev); - iio_kfifo_free(indio_dev->buffer); iio_buffer_unregister(indio_dev); } -- 1.8.4.rc3 -- 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