diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2019-02-21 09:41:11 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2019-02-21 09:41:11 +0000 |
| commit | 039e406603852e9ddb23b5965b6956d42304bc55 (patch) | |
| tree | 6a706ed412d6546a25077931d14daae02c75eedb /hw/usb/redirect.c | |
| parent | 2e68b8620637a4ee8c79b5724144b726af1e261b (diff) | |
| parent | 7011baece29d0e197c54c4e57326ba88e67a4949 (diff) | |
| download | focaccia-qemu-039e406603852e9ddb23b5965b6956d42304bc55.tar.gz focaccia-qemu-039e406603852e9ddb23b5965b6956d42304bc55.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20190220-pull-request' into staging
usb: usb_ep_get() fixes # gpg: Signature made Wed 20 Feb 2019 11:13:32 GMT # gpg: using RSA key 4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/usb-20190220-pull-request: usb: remove unnecessary NULL device check from usb_ep_get() usb: add device checks before redirector calls to usb_ep_get() usb: check device is not NULL before calling usb_ep_get() uhci: check device is not NULL before calling usb_ep_get() ohci: check device is not NULL before calling usb_ep_get() ehci: check device is not NULL before calling usb_ep_get() xhci: check device is not NULL before calling usb_ep_get() xhci: add asserts to help with static code analysis usb: rearrange usb_ep_get() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/usb/redirect.c')
| -rw-r--r-- | hw/usb/redirect.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index 18a42d1938..7cb6b120d4 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -1728,6 +1728,7 @@ static void usbredir_ep_info(void *priv, USBRedirDevice *dev = priv; int i; + assert(dev != NULL); for (i = 0; i < MAX_ENDPOINTS; i++) { dev->endpoint[i].type = ep_info->type[i]; dev->endpoint[i].interval = ep_info->interval[i]; @@ -2125,7 +2126,7 @@ static int usbredir_post_load(void *priv, int version_id) { USBRedirDevice *dev = priv; - if (dev->parser == NULL) { + if (dev == NULL || dev->parser == NULL) { return 0; } |