Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
---
hw/sd/sd.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 0ecb446fdb..c2f01a5fa3 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -1390,6 +1390,14 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
SDRequest req)
/* Application specific commands (Class 8) */
case 55: /* CMD55: APP_CMD */
+ switch (sd->state) {
+ case sd_ready_state:
+ case sd_identification_state:
+ case sd_inactive_state:
+ return sd_illegal;
+ default:
+ break;
+ }
if (!sd->spi) {
if (sd->rca != rca) {
return sd_r0;
--
2.16.1