提交 98861f51 编写于 作者: G Gerd Hoffmann

usb: handle dev == NULL in usb_handle_packet()

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: NGerd Hoffmann <kraxel@redhat.com>
上级 06c75088
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册