diff options
author | hselasky <hselasky@FreeBSD.org> | 2012-04-20 14:29:45 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2012-04-20 14:29:45 +0000 |
commit | 3463f3d087f68b3d32ecd9ccc77f8a2f8aef482d (patch) | |
tree | 7bba82ab4db6a05960a26e4d19378f7bd40ea21c /lib/libusb/libusb10_desc.c | |
parent | 433fc8eeffa614ac974539d56caf875a8b001065 (diff) | |
download | FreeBSD-src-3463f3d087f68b3d32ecd9ccc77f8a2f8aef482d.zip FreeBSD-src-3463f3d087f68b3d32ecd9ccc77f8a2f8aef482d.tar.gz |
Fix some compile warnings.
MFC after: 1 week
Diffstat (limited to 'lib/libusb/libusb10_desc.c')
-rw-r--r-- | lib/libusb/libusb10_desc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libusb/libusb10_desc.c b/lib/libusb/libusb10_desc.c index 6d5822e..8e39bab 100644 --- a/lib/libusb/libusb10_desc.c +++ b/lib/libusb/libusb10_desc.c @@ -390,8 +390,8 @@ libusb_parse_bos_descriptor(const void *buf, int len, struct libusb_bos_descriptor **bos) { struct libusb_bos_descriptor *ptr; - struct libusb_usb_2_0_device_capability_descriptor *dcap_20; - struct libusb_ss_usb_device_capability_descriptor *ss_cap; + struct libusb_usb_2_0_device_capability_descriptor *dcap_20 = NULL; + struct libusb_ss_usb_device_capability_descriptor *ss_cap = NULL; if (buf == NULL || bos == NULL || len < 1) return (LIBUSB_ERROR_INVALID_PARAM); @@ -438,7 +438,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, dtype == LIBUSB_DT_DEVICE_CAPABILITY) { switch (((const uint8_t *)buf)[2]) { case LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY: - if (ptr->usb_2_0_ext_cap != NULL) + if (ptr->usb_2_0_ext_cap != NULL || dcap_20 == NULL) break; if (dlen < LIBUSB_USB_2_0_EXTENSION_DEVICE_CAPABILITY_SIZE) break; @@ -455,7 +455,7 @@ libusb_parse_bos_descriptor(const void *buf, int len, break; case LIBUSB_SS_USB_DEVICE_CAPABILITY: - if (ptr->ss_usb_cap != NULL) + if (ptr->ss_usb_cap != NULL || ss_cap == NULL) break; if (dlen < LIBUSB_SS_USB_DEVICE_CAPABILITY_SIZE) break; |