Skip to content

Commit

Permalink
Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"
Browse files Browse the repository at this point in the history
This reverts commit a1cbfd5.

Test isn't useless.  scsi_req_enqueue() may finish the request (will
actually happen for requests which don't trigger any I/O such as
INQUIRY), then call usb_msd_command_complete() which in turn will
set s->req to NULL after unref'ing it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
  • Loading branch information
kraxel committed Jan 22, 2013
1 parent 1356b98 commit f4c0e50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/usb/dev-storage.c
Expand Up @@ -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->cmd.xfer != SCSI_XFER_NONE) {
if (s->req && s->req->cmd.xfer != SCSI_XFER_NONE) {
scsi_req_continue(s->req);
}
break;
Expand Down

0 comments on commit f4c0e50

Please sign in to comment.