[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150320115854.GA17858@earth>
Date: Fri, 20 Mar 2015 12:58:54 +0100
From: Sebastian Reichel <sre@...nel.org>
To: Krzysztof Kozlowski <k.kozlowski@...sung.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] power_supply: 88pm860x_charger: Fix possible NULL
pointer dereference and use of initialized variable
Hi Krzysztof,
On Fri, Mar 20, 2015 at 10:26:02AM +0100, Krzysztof Kozlowski wrote:
> Do not put reference to power supply in early exit paths of
> pm860x_done_handler() because:
> 1. it is not yet initialized,
> 2. it is NULL.
>
> This fixes possible NULL pointer dereference and following build
> warning:
> drivers/power/88pm860x_charger.c: In function ‘pm860x_done_handler’:
> drivers/power/88pm860x_charger.c:516:18: warning: ‘psy’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> Additionally this puts the power supply reference before unlocking
> mutex. This actually is not needed (there is no race here) but has
> logical sense and makes the exit paths cleaner.
>
> Reported-by: kbuild test robot <fengguang.wu@...el.com>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
Thanks, pulled.
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists