From: Alan Cox Date: Mon, 2 Jul 2012 17:55:13 +0000 (+0100) Subject: mmc: core: correct invalid error checking X-Git-Tag: upstream/snapshot3+hdmi~7025^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b63b5e819d5b21ae493c17c356018ffa98d3ee1c;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mmc: core: correct invalid error checking 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 Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index b0b9e37..33c6f26 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);