From: Mark Cave-Ayland Date: Fri, 12 Jan 2024 12:52:53 +0000 (+0000) Subject: esp.c: don't clear cmdfifo when esp_select() fails in get_cmd() X-Git-Tag: v9.0.0-rc0~66^2~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f3ace75be8;p=thirdparty%2Fqemu.git esp.c: don't clear cmdfifo when esp_select() fails in get_cmd() The FIFO contents should not be affected if the target selection fails. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Tested-by: Thomas Huth Message-Id: <20240112125420.514425-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Mark Cave-Ayland --- diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 3a1c9f7c3b8..68d07edc052 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -252,11 +252,9 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen) fifo8_push_all(&s->cmdfifo, buf, dmalen); } else { if (esp_select(s) < 0) { - fifo8_reset(&s->cmdfifo); return -1; } esp_raise_drq(s); - fifo8_reset(&s->cmdfifo); return 0; } } else { @@ -271,7 +269,6 @@ static uint32_t get_cmd(ESPState *s, uint32_t maxlen) trace_esp_get_cmd(dmalen, target); if (esp_select(s) < 0) { - fifo8_reset(&s->cmdfifo); return -1; } return dmalen;