Skip to contentSkip to conversation

scsi-bus: Don't mask rc of scsi_req_parse_cdb

PATCH New Fam Zheng 1 participant 1 message Oct 30, 2014

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 scsi-bus: Don't mask rc of scsi_req_parse_cdb

If the previous call failed, we can skip the second one.

---
 hw/scsi/scsi-bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/scsi/scsi-bus.c +1 -1
index af7707c..0661f70 100644
@@ -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;
Signature · 1 line
1.9.3