Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Ido Yariv <ido@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] wl12xx: Fix validation of pm_runtime_get_sync return value
Date: Thu, 11 Aug 2011 08:57:44 +0300	[thread overview]
Message-ID: <1313042264.2407.759.camel@cumari> (raw)
In-Reply-To: <1312269858-30434-2-git-send-email-ido@wizery.com>

On Tue, 2011-08-02 at 10:24 +0300, Ido Yariv wrote: 
> wl1271_sdio_power_on checks if the return value of pm_runtime_get_sync
> is non-zero, and if so bails out.
> However, pm_runtime_get_sync can return a positive number which does not
> suggest an error has occurred. This is problematic for two reasons:
> 
> 1. The function will needlessly bail out without decrementing back the
>    runtime PM reference counter.
> 2. wl1271_power_on only checks if wl1271_power_on return value is
>    negative. This means that wl1271_power_on will continue even if
>    wl1271_sdio_power_on bailed out. As a result, sdio transactions will
>    be initiated without properly enabling the sdio function and claiming
>    the host. This could even lead to a kernel panic.
> 
> Fix this by only checking that the return value of pm_runtime_get_sync
> is non-negative.
> 
> Signed-off-by: Ido Yariv <ido@wizery.com>
> ---

Acked-by: Luciano Coelho <coelho@ti.com>

-- 
Cheers,
Luca.


  reply	other threads:[~2011-08-11  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02  7:24 [PATCH 1/2] wl12xx: Remove obsolete testmode NVS push command Ido Yariv
2011-08-02  7:24 ` [PATCH 2/2] wl12xx: Fix validation of pm_runtime_get_sync return value Ido Yariv
2011-08-11  5:57   ` Luciano Coelho [this message]
2011-08-11  5:57 ` [PATCH 1/2] wl12xx: Remove obsolete testmode NVS push command Luciano Coelho

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=1313042264.2407.759.camel@cumari \
    --to=coelho@ti.com \
    --cc=ido@wizery.com \
    --cc=linux-wireless@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox