lkml.org 
[lkml]   [2015]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] HID: hid-input: Fix accessing freed memory during driver unbind
From
2015-08-01 21:11 GMT+09:00 Jiri Kosina <jkosina@suse.com>:
> 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?


Of course, I'll send next version.

Best regards,
Krzysztof


\
 
 \ /
  Last update: 2015-08-02 07:41    [W:0.104 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site