USB host composite: A test should be <= not just <

This commit is contained in:
Gregory Nutt 2016-08-31 13:24:38 -06:00
parent 1431dcd8d5
commit ebe829c4b9

View File

@ -560,7 +560,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
desc = (FAR struct usb_desc_s *)&configdesc[offset];
int len = desc->len;
if (offset + len < desclen)
if (offset + len <= desclen)
{
/* Is this an interface descriptor? */
@ -673,7 +673,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
desc = (FAR struct usb_desc_s *)&configdesc[offset];
int len = desc->len;
if (offset + len < desclen)
if (offset + len <= desclen)
{
/* Is this an interface descriptor? */
@ -750,7 +750,7 @@ int usbhost_composite(FAR struct usbhost_hubport_s *hport,
cfgbuffer = (FAR uint8_t *)malloc(CUSTOM_CONFIG_BUFSIZE);
if (cfgbuffer == NULL)
{
uerr("ERROR: Failed to allocated configuration buffer");
uerr("ERROR: Failed to allocate configuration buffer");
ret = -ENOMEM;
goto errout_with_members;
}