lkml.org 
[lkml]   [2015]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] HID: hid-input: Fix accessing freed memory during driver unbind
On Tue, 28 Jul 2015, Krzysztof Kozlowski wrote:

> During unbinding the driver was dereferencing a pointer to memory
> already freed by power_supply_unregister().
>
> Driver was freeing its internal description of battery through pointers
> stored in power_supply structure. However, because the core owns the
> power supply instance, after calling power_supply_unregister() the
> driver cannot access these members.
>
> Fix this by using resource-managed allocations so internal data will be
> freed by pointers stored in resource-managed core.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reported-by: H.J. Lu <hjl.tools@gmail.com>
> Fixes: 297d716f6260 ("power_supply: Change ownership from driver to core")
> Cc: <stable@vger.kernel.org>

Applied to for-4.2/upstream-fixes, thanks.

--
Jiri Kosina
SUSE Labs


\
 
 \ /
  Last update: 2015-07-29 21:11    [W:0.166 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site