Skip to content

Commit

Permalink
esp.c: don't clear cmdfifo when esp_select() fails in get_cmd()
Browse files Browse the repository at this point in the history
The FIFO contents should not be affected if the target selection fails.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20240112125420.514425-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
  • Loading branch information
mcayland committed Feb 13, 2024
1 parent bc2e8b1 commit f3ace75
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions hw/scsi/esp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down

0 comments on commit f3ace75

Please sign in to comment.