summaryrefslogtreecommitdiffstats
path: root/hw/usb/dev-storage.c
diff options
context:
space:
mode:
authorMarkus Armbruster2013-01-16 18:20:25 +0100
committerAnthony Liguori2013-01-16 19:03:15 +0100
commita1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2 (patch)
tree8deb6383cacf6c30dbffa5702382aa7e8e4f1920 /hw/usb/dev-storage.c
parentui: Drop useless null tests in parse_keyboard_layout() (diff)
downloadqemu-a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2.tar.gz
qemu-a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2.tar.xz
qemu-a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2.zip
usb-storage: Drop useless null test in usb_msd_handle_data()
scsi_req_new() never returns null, and scsi_req_enqueue() dereferences the pointer, so checking for null is useless. Spotted by Coverity. Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r--hw/usb/dev-storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 1b87352db0..b839798eaf 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -427,7 +427,7 @@ static void usb_msd_handle_data(USBDevice *dev, USBPacket *p)
scsi_req_print(s->req);
#endif
scsi_req_enqueue(s->req);
- if (s->req && s->req->cmd.xfer != SCSI_XFER_NONE) {
+ if (s->req->cmd.xfer != SCSI_XFER_NONE) {
scsi_req_continue(s->req);
}
break;