From: RemZapCypher <[email protected]> Fixing Null pointer dereference & Async/Sync IDENTICAL_BRANCHES
Reported-by: Stefan Hajnoczi <[email protected]> --- hw/scsi/ncr53c710.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c index b3d4593b72..dd9884c8bf 100644 --- a/hw/scsi/ncr53c710.c +++ b/hw/scsi/ncr53c710.c @@ -834,13 +834,11 @@ void ncr710_transfer_data(SCSIRequest *req, uint32_t len) } } - /* Host adapter (re)connected */ - s->current->dma_len = len; s->command_complete = NCR710_CMD_DATA_READY; - if (!s->current) { - return; + s->current = (NCR710Request *)req->hba_private; } + s->current->dma_len = len; if (s->waiting) { s->scntl1 |= NCR710_SCNTL1_CON; @@ -1367,11 +1365,6 @@ again: case PHASE_DI: s->waiting = NCR710_WAIT_DMA; ncr710_do_dma(s, 0); - if (s->waiting != NCR710_WAIT_NONE) { - /* Async - stop and wait */ - break; - } - /* Sync - continue execution */ break; case PHASE_CO: ncr710_do_command(s); -- 2.49.0
