]> Git Repo - qemu.git/commitdiff
hw/sd/sdcard: Zero out function selection fields before being populated
authorBin Meng <[email protected]>
Sat, 24 Oct 2020 01:49:54 +0000 (09:49 +0800)
committerPhilippe Mathieu-Daudé <[email protected]>
Mon, 26 Oct 2020 08:23:47 +0000 (09:23 +0100)
The function selection fields (399:376) should be zeroed out to
prevent leftover from being or'ed into the switch function status
data structure.

This fixes the boot failure as seen in the acceptance testing on
the orangepi target.

Fixes: b638627c723a ("hw/sd: Fix incorrect populated function switch status data structure")
Reported-by: Michael Roth <[email protected]>
Signed-off-by: Bin Meng <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201024014954[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
hw/sd/sd.c

index fcbc1fd9d6e2a7470c51f357f351a0353b45e021..309138261455dcedf8077d29de37632959e30192 100644 (file)
@@ -827,6 +827,7 @@ static void sd_function_switch(SDState *sd, uint32_t arg)
     sd->data[12] = 0x80;       /* Supported group 1 functions */
     sd->data[13] = 0x03;
 
+    memset(&sd->data[14], 0, 3);
     for (i = 0; i < 6; i ++) {
         new_func = (arg >> (i * 4)) & 0x0f;
         if (mode && new_func != 0x0f)
This page took 0.032281 seconds and 4 git commands to generate.