lkml.org 
[lkml]   [2012]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] drivers/iio/adc/at91_adc.c: use devm_ functions
On Tue, 31 Jul 2012, Lars-Peter Clausen wrote:

> Hi,
>
> On 07/31/2012 12:09 PM, Julia Lawall wrote:
> > From: Julia Lawall <Julia.Lawall@lip6.fr>
> > @@ -720,20 +698,14 @@ error_ret:
> > static int __devexit at91_adc_remove(struct platform_device *pdev)
> > {
> > struct iio_dev *idev = platform_get_drvdata(pdev);
> > - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > struct at91_adc_state *st = iio_priv(idev);
> >
> > iio_device_unregister(idev);
> > [...]
> > - free_irq(st->irq, idev);
> > [...]
> > iio_device_free(idev);
>
> I think we have to be careful here. The interrupted is now freed after the
> device has been freed, which means that it could trigger after the device
> has been freed. And since we use the device in the interrupt handler we'll
> get a use after free.

OK, thanks for the feedback. I'll try again, and un-devm_ this function.

julia


\
 
 \ /
  Last update: 2012-07-31 15:21    [W:0.069 / U:2.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site