]> xenbits.xensource.com Git - qemu-xen-4.4-testing.git/commitdiff
hw/sd.c: On CRC error, set CRC error status bit rather than clearing it
authorPeter Maydell <peter.maydell@linaro.org>
Sun, 18 Dec 2011 20:37:53 +0000 (21:37 +0100)
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>
Wed, 21 Dec 2011 04:01:21 +0000 (05:01 +0100)
If we fail to validate the CRC for an SD command we should be setting
COM_CRC_ERROR, not clearing it. (This bug actually has no effect currently
because sd_req_crc_validate() always returns success.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/sd.c

diff --git a/hw/sd.c b/hw/sd.c
index 245b6c30466dc6bf778ae14fef3b0f1bdd4a1813..e57852e19d0548a938e6234b73d6172e71a27c31 100644 (file)
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -1300,7 +1300,7 @@ int sd_do_command(SDState *sd, SDRequest *req,
     }
 
     if (sd_req_crc_validate(req)) {
-        sd->card_status &= ~COM_CRC_ERROR;
+        sd->card_status |= COM_CRC_ERROR;
         return 0;
     }