STM32 USB device. Add protection in the event that out-of-bound enpoint numbers are received. From David Sidrane.

This commit is contained in:
Gregory Nutt 2015-05-02 10:58:27 -06:00
parent 0577a54d18
commit def19bad48
2 changed files with 250 additions and 242 deletions

View File

@ -3124,6 +3124,9 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv)
/* Decode status fields */
epphy = (regval & OTGFS_GRXSTSD_EPNUM_MASK) >> OTGFS_GRXSTSD_EPNUM_SHIFT;
if (epphy < STM32_NENDPOINTS)
{
privep = &priv->epout[epphy];
/* Handle the RX event according to the packet status field */
@ -3251,6 +3254,7 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv)
}
break;
}
}
/* Enable the Rx Status Queue Level interrupt */

View File

@ -3124,6 +3124,9 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv)
/* Decode status fields */
epphy = (regval & OTGHS_GRXSTSD_EPNUM_MASK) >> OTGHS_GRXSTSD_EPNUM_SHIFT;
if (epphy < STM32_NENDPOINTS)
{
privep = &priv->epout[epphy];
/* Handle the RX event according to the packet status field */
@ -3251,6 +3254,7 @@ static inline void stm32_rxinterrupt(FAR struct stm32_usbdev_s *priv)
}
break;
}
}
/* Enable the Rx Status Queue Level interrupt */