All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power_supply: 88pm860x_charger: Fix possible NULL pointer dereference and use of initialized variable
Date: Fri, 20 Mar 2015 12:58:54 +0100	[thread overview]
Message-ID: <20150320115854.GA17858@earth> (raw)
In-Reply-To: <1426843562-6415-1-git-send-email-k.kozlowski@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

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@intel.com>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Thanks, pulled.

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-03-20 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20  9:26 [PATCH] power_supply: 88pm860x_charger: Fix possible NULL pointer dereference and use of initialized variable Krzysztof Kozlowski
2015-03-20 11:58 ` Sebastian Reichel [this message]

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=20150320115854.GA17858@earth \
    --to=sre@kernel.org \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.