]> git.proxmox.com Git - mirror_qemu.git/commit
usb: check device is not NULL before calling usb_ep_get()
authorLiam Merwick <liam.merwick@oracle.com>
Wed, 6 Feb 2019 13:36:54 +0000 (13:36 +0000)
committerGerd Hoffmann <kraxel@redhat.com>
Wed, 20 Feb 2019 08:41:23 +0000 (09:41 +0100)
commite87fd1e6e547a80b3e403e882b829d2750e24e44
tree6af1f6c8720f4ad3888bf2548f3f5a43c6958971
parentff668537b6ec172b797091d11a228a97c4bfca8e
usb: check device is not NULL before calling usb_ep_get()

In musb_packet(), the call to usb_find_device() can return NULL
if it doesn't find a device matching 'addr' so explicitly check
the return value before passing it to usb_ep_get().  This then
allows the subsequent calculation of 'id' to be streamlined.

Signed-off-by: Liam Merwick <liam.merwick@oracle.com>
Message-id: 1549460216-25808-8-git-send-email-liam.merwick@oracle.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-musb.c