From: Sebastian Reichel <sre@kernel.org>
To: Vaishali Thakkar <vthakkar1994@gmail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power_supply: Adjust devm usage
Date: Fri, 24 Jul 2015 14:59:51 +0200 [thread overview]
Message-ID: <20150724125951.GA25447@earth> (raw)
In-Reply-To: <CAK-LDbKk5wYAKVJ9eE5Kr6iOW1ah6VxAxBWcZjbufHp8WZXW=g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]
Hi,
On Fri, Jul 24, 2015 at 06:03:38PM +0530, Vaishali Thakkar wrote:
> On Fri, Jul 24, 2015 at 5:56 PM, Sebastian Reichel <sre@kernel.org> wrote:
> > On Fri, Jul 24, 2015 at 05:28:13PM +0530, Vaishali Thakkar wrote:
> >> @@ -267,8 +267,9 @@ static int bq24735_charger_probe() {}
> >> [...]
> >
> > Your patch is missing removal of the
> > kfree(charger->charger_desc.name) in bq24735_charger_remove().
>
> Yes. Because it seems that this kfree is freeing some other data which
> is not related to devm_kzalloc. I was not sure about removing it.
> So, I was about to discuss it in a separate thread.s
it's assigned in the probe function:
name = kasprintf(...);
...
supply_desc->name = name;
...
power_supply_register(..., supply_desc, ...);
> Also, in the remove function we have devm_free_irq. I am unsure it
> too. Because normally remove functions do not use devm
> counterparts.
It's required to free the irq before removing the power supply
device.
If the power supply is registered with devm, that should happen
automatically, since it is requested before the irq. Thus the
remove function can be removed completely at that point :)
-- Sebastian
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-07-24 12:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-24 11:58 [PATCH] power_supply: Adjust devm usage Vaishali Thakkar
2015-07-24 12:17 ` Frans Klaver
2015-07-24 12:29 ` Krzysztof Kozlowski
2015-07-24 12:35 ` Vaishali Thakkar
2015-07-24 12:26 ` Sebastian Reichel
2015-07-24 12:33 ` Vaishali Thakkar
2015-07-24 12:59 ` Sebastian Reichel [this message]
2015-07-24 13:14 ` Vaishali Thakkar
2015-07-24 13:38 ` Sebastian Reichel
2015-07-24 13:42 ` Vaishali Thakkar
2015-07-24 12:36 ` Krzysztof Kozlowski
2015-07-24 12:39 ` Frans Klaver
2015-07-24 13:01 ` Sebastian Reichel
2015-08-02 6:53 ` Pavel Machek
2015-08-03 17:29 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150724125951.GA25447@earth \
--to=sre@kernel.org \
--cc=dbaryshkov@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=vthakkar1994@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).