lkml.org 
[lkml]   [2015]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFT PATCH v3 2/2] compal-laptop: Check return value of power_supply_register
On Fri, Feb 20, 2015 at 02:13:35PM +0100, Krzysztof Kozlowski wrote:
> The return value of power_supply_register() call was not checked and
> even on error probe() function returned 0. If registering failed then
> during unbind the driver tried to unregister power supply which was not
> actually registered.
>
> This could lead to memory corruption because power_supply_unregister()
> unconditionally cleans up given power supply.
>
> Fix this by checking return status of power_supply_register() call. In
> case of failure, clean up sysfs entries and fail the probe.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Fixes: 9be0fcb5ed46 ("compal-laptop: add JHL90, battery & hwmon interface")
> Cc: <stable@vger.kernel.org>

Acked-by: Darren Hart <dvhart@linux.intel.com>

--
Darren Hart
Intel Open Source Technology Center


\
 
 \ /
  Last update: 2015-03-03 18:01    [W:0.064 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site