[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130106023730.GA6919@lizard.sbx05280.losalca.wayport.net>
Date: Sat, 5 Jan 2013 18:37:30 -0800
From: Anton Vorontsov <anton@...msg.org>
To: Tushar Behera <tushar.behera@...aro.org>
Cc: linux-kernel@...r.kernel.org, dwmw2@...radead.org,
patches@...aro.org
Subject: Re: [PATCH] power: 88pm860x_battery: Add a few more devm_* APIs
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.behera@...aro.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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists