diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2013-01-21 11:18:47 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2013-01-22 11:01:07 +0100 |
commit | f4c0e5011b96d67b87db407854ee948da708a0d9 (patch) | |
tree | 586e92d8e7017b9cb940b881dd8b5fe26a7ea617 /hw/usb/dev-storage.c | |
parent | 1356b98d3e95a85071e6bf9a99e8799e1ae1bbee (diff) | |
download | qemu-f4c0e5011b96d67b87db407854ee948da708a0d9.zip |
Revert "usb-storage: Drop useless null test in usb_msd_handle_data()"
This reverts commit a1cbfd554e11bb8af38c2f3e1f1574bf4c563cd2.
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>
Diffstat (limited to 'hw/usb/dev-storage.c')
-rw-r--r-- | hw/usb/dev-storage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index b839798eaf..1b87352db0 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->cmd.xfer != SCSI_XFER_NONE) { + if (s->req && s->req->cmd.xfer != SCSI_XFER_NONE) { scsi_req_continue(s->req); } break; |