linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: adc: ti_am335x_adc: do not free the kfifo twice
@ 2013-10-23 17:00 Sebastian Andrzej Siewior
  2013-10-23 17:00 ` [PATCH 2 / 2] iio: ti_am335x_adc: adjust the closing bracket in tiadc_read_raw() Sebastian Andrzej Siewior
  2013-10-23 19:36 ` [PATCH 1/2 v2] iio: adc: ti_am335x_adc: do not free the kfifo twice Sebastian Andrzej Siewior
  0 siblings, 2 replies; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2013-10-23 17:00 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Felipe Balbi, linux-iio, Sebastian Andrzej Siewior,
	Lars-Peter Clausen

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@metafoo.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---

By no means I am the expert here but the other users of iio_kfifo_free() like

drivers/iio/industrialio-triggered-buffer.c:    iio_kfifo_free(indio_dev->buffer);
drivers/iio/industrialio-triggered-buffer.c:    iio_kfifo_free(indio_dev->buffer);

are probably wrong, too. Not to mention staging. So *I* think iio_kfifo_free()
should vanish from the tree.

 drivers/iio/adc/ti_am335x_adc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index f974dea..3d70f09 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-10-23 23:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 17:00 [PATCH 1/2] iio: adc: ti_am335x_adc: do not free the kfifo twice Sebastian Andrzej Siewior
2013-10-23 17:00 ` [PATCH 2 / 2] iio: ti_am335x_adc: adjust the closing bracket in tiadc_read_raw() Sebastian Andrzej Siewior
2013-10-23 19:36 ` [PATCH 1/2 v2] iio: adc: ti_am335x_adc: do not free the kfifo twice Sebastian Andrzej Siewior
2013-10-23 23:04   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).