usb-storage: Drop useless null test in usb_msd_handle_data()
authorMarkus Armbruster <armbru@redhat.com>
Wed, 16 Jan 2013 17:20:25 +0000 (18:20 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 16 Jan 2013 18:03:15 +0000 (12:03 -0600)
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>
hw/usb/dev-storage.c

index 1b87352db01ff9dcae36d6aa878dcc3037631003..b839798eafc4118d6a5238bbe238048115e7573f 100644 (file)
@@ -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;