On Fri, Nov 23, 2012 at 06:11:52PM +0530, Tushar Behera wrote:
> Add devm_* APIs for threaded IRQ.
> 
> Also since devres managed objects are removed when the device gets
> detached, remove explicit freeing of them.
> 
> Signed-off-by: Tushar Behera <tushar.beh...@linaro.org>
> ---
[...]
> @@ -994,9 +988,6 @@ static int __devexit pm860x_battery_remove(struct 
> platform_device *pdev)
>       struct pm860x_battery_info *info = platform_get_drvdata(pdev);
>  
>       power_supply_unregister(&info->battery);
> -     free_irq(info->irq_batt, info);
> -     free_irq(info->irq_cc, info);
> -     kfree(info);

It is not safe to access battery ('struct power_supply') object after
_unregister() (and irq handlers will surely do). Instead of removing
free_irq(), you should place the two calls before _unregister().

Thanks,

>       platform_set_drvdata(pdev, NULL);
>       return 0;
>  }
> -- 
> 1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to