Message ID | 1414653262-7601-1-git-send-email-famz@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index af7707c..0661f70 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -67,7 +67,7 @@ int scsi_bus_parse_cdb(SCSIDevice *dev, SCSICommand *cmd, uint8_t *buf, assert(cmd->len == 0); rc = scsi_req_parse_cdb(dev, cmd, buf); - if (bus->info->parse_cdb) { + if (!rc && bus->info->parse_cdb) { rc = bus->info->parse_cdb(dev, cmd, buf, hba_private); } return rc;
If the previous call failed, we can skip the second one. Signed-off-by: Fam Zheng <famz@redhat.com> --- hw/scsi/scsi-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)