It is already done by ncr710_request_free, so it is only needed when
the function is not called.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/scsi/ncr53c710.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/ncr53c710.c b/hw/scsi/ncr53c710.c
index ff0d3cf0c86..fd03f243eda 100644
--- a/hw/scsi/ncr53c710.c
+++ b/hw/scsi/ncr53c710.c
@@ -748,7 +748,6 @@ void ncr710_request_cancelled(SCSIRequest *req)
NCR710State *s = ncr710_from_scsi_bus(req->bus);
NCR710Request *p = (NCR710Request *)req->hba_private;
if (p) {
- req->hba_private = NULL;
ncr710_request_free(s, p);
}
}
@@ -791,8 +790,9 @@ void ncr710_command_complete(SCSIRequest *req, size_t resid)
ncr710_set_phase(s, PHASE_ST);
if (p) {
- req->hba_private = NULL;
- if (p != s->current) {
+ if (p == s->current) {
+ req->hba_private = NULL;
+ } else {
ncr710_request_free(s, p);
}
}
--
2.53.0