projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ebffe2a
)
usb-storage: fix NULL pointer dereference.
author
Gerd Hoffmann
<kraxel@redhat.com>
Fri, 2 Sep 2011 11:05:13 +0000
(13:05 +0200)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Thu, 13 Oct 2011 10:58:51 +0000
(12:58 +0200)
When a usb packet is canceled we need to check whenever we actually have
a scsi request in flight before we try to cancel it.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-msd.c
patch
|
blob
|
history
diff --git
a/hw/usb-msd.c
b/hw/usb-msd.c
index e92434cc942446310234b0251c44cf8667ec685e..08d2d2ac774807334cc939384f3c3bbdc0da38e6 100644
(file)
--- a/
hw/usb-msd.c
+++ b/
hw/usb-msd.c
@@
-325,7
+325,10
@@
static int usb_msd_handle_control(USBDevice *dev, USBPacket *p,
static void usb_msd_cancel_io(USBDevice *dev, USBPacket *p)
{
MSDState *s = DO_UPCAST(MSDState, dev, dev);
- scsi_req_cancel(s->req);
+
+ if (s->req) {
+ scsi_req_cancel(s->req);
+ }
}
static int usb_msd_handle_data(USBDevice *dev, USBPacket *p)