projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
06c7508
)
usb: handle dev == NULL in usb_handle_packet()
author
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 10 Jan 2012 16:33:02 +0000
(17:33 +0100)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Fri, 10 Feb 2012 10:31:57 +0000
(11:31 +0100)
Allow passing in a NULL pointer, return USB_RET_NODEV in that case.
Removes the burden to to a NULL pointer check from the callers.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb.c
patch
|
blob
|
history
diff --git
a/hw/usb.c
b/hw/usb.c
index bacdc81bfc4676a11dce4b4b4fb60de7d8449c1e..9976f81bd7d189c0ec16a9eb19bb73f62152d5d9 100644
(file)
--- a/
hw/usb.c
+++ b/
hw/usb.c
@@
-315,6
+315,10
@@
int usb_handle_packet(USBDevice *dev, USBPacket *p)
{
int ret;
+ if (dev == NULL) {
+ return USB_RET_NODEV;
+ }
+
assert(p->owner == NULL);
ret = usb_device_handle_packet(dev, p);
if (ret == USB_RET_ASYNC) {