* [Qemu-devel] [PATCH] scsi-bus: Don't mask rc of scsi_req_parse_cdb
@ 2014-10-30 7:14 Fam Zheng
0 siblings, 0 replies; only message in thread
From: Fam Zheng @ 2014-10-30 7:14 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini
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(-)
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;
--
1.9.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-30 7:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30 7:14 [Qemu-devel] [PATCH] scsi-bus: Don't mask rc of scsi_req_parse_cdb Fam Zheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).