]> git.neil.brown.name Git - gta04.git/commitdiff
mmc: core: correct invalid error checking
authorAlan Cox <alan@linux.intel.com>
Mon, 2 Jul 2012 17:55:13 +0000 (18:55 +0100)
committerChris Ball <cjb@laptop.org>
Sat, 21 Jul 2012 04:02:24 +0000 (00:02 -0400)
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>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/sd.c

index b0b9e372f5da0569ae7ab8d888c4cd36289f7df6..33c6f26c68d05a99165445fa11e6cf2d6540216f 100644 (file)
@@ -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);