public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: correct invalid error checking
Date: Mon, 02 Jul 2012 13:17:21 -0400	[thread overview]
Message-ID: <87mx3i84m6.fsf@octavius.laptop.org> (raw)
In-Reply-To: <20120702175509.10520.24093.stgit@bluebook> (Alan Cox's message of "Mon, 02 Jul 2012 18:55:13 +0100")

Hi,

On Mon, Jul 02 2012, Alan Cox wrote:
> From: Alan Cox <alan@linux.intel.com>
>
> The effect of the existing code is that we continue blindly when we should
> warn about an invalid allocation unit
>
> Reported-by: dcb314@hotmail.com
> Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44061
> Signed-off-by: Alan Cox <alan@linux.intel.com>
> ---
>
>  drivers/mmc/core/sd.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index c272c686..c52f12b 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -244,7 +244,7 @@ static int mmc_read_ssr(struct mmc_card *card)
>  	 * bitfield positions accordingly.
>  	 */
>  	au = UNSTUFF_BITS(ssr, 428 - 384, 4);
> -	if (au > 0 || au <= 9) {
> +	if (au > 0 && au <= 9) {
>  		card->ssr.au = 1 << (au + 4);
>  		es = UNSTUFF_BITS(ssr, 408 - 384, 16);
>  		et = UNSTUFF_BITS(ssr, 402 - 384, 6);

Thanks, pushed to mmc-next for 3.6.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

           reply	other threads:[~2012-07-02 17:17 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20120702175509.10520.24093.stgit@bluebook>]

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=87mx3i84m6.fsf@octavius.laptop.org \
    --to=cjb@laptop.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-mmc@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