From: Jiri Kosina <jkosina@suse.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
sre@kernel.org, linux-pm@vger.kernel.org,
"H.J. Lu" <hjl.tools@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] HID: hid-input: Fix accessing freed memory during driver unbind
Date: Sat, 1 Aug 2015 14:11:40 +0200 (CEST) [thread overview]
Message-ID: <alpine.LNX.2.00.1508011410170.925@pobox.suse.cz> (raw)
In-Reply-To: <20150730001026.GH23178@dtor-ws>
On Wed, 29 Jul 2015, Dmitry Torokhov wrote:
> > Another and less intrusive fix would be:
> >
> > char *name = dev->battery->desc->name;
> > struct power_supply_desc *psy_desc = dev->battery->desc;
> > power_supply_unregister(dev->battery);
> > kfree(name);
> > kfree(psy_desc);
>
> I would much rather prefer this to the other version as it does not
> leave memory hanging around, potentially indefinitely, but ultimately it
> is up to Jiri.
I must have been in some broken state of mind when applying the original
one, thanks a lot for catching my brainfart, Dmitry!
Kryzstof, could you please send me properly formatted patch with the
above, on top of your previous fix?
Thanks.
--
Jiri Kosina
SUSE Labs
next prev parent reply other threads:[~2015-08-01 12:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 0:16 [PATCH] HID: hid-input: Fix accessing freed memory during driver unbind Krzysztof Kozlowski
2015-07-29 13:07 ` Jiri Kosina
2015-07-29 17:46 ` Dmitry Torokhov
2015-07-29 23:42 ` Krzysztof Kozlowski
2015-07-30 0:10 ` Dmitry Torokhov
2015-08-01 12:11 ` Jiri Kosina [this message]
2015-08-02 5:09 ` Krzysztof Kozlowski
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=alpine.LNX.2.00.1508011410170.925@pobox.suse.cz \
--to=jkosina@suse.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hjl.tools@gmail.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
--cc=stable@vger.kernel.org \
/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