Fix memory corruption in USB code.
Crash occurs on my machine shortly after power up. `hhid` is null at the time it occurs so the change to `hhid->state` causes a crash.
This commit is contained in:
parent
2db432a2b7
commit
705a2c565b
|
@ -398,7 +398,7 @@ uint8_t USBD_HID_SendReport (USBD_HandleTypeDef *pdev,
|
|||
{
|
||||
USBD_HID_HandleTypeDef *hhid = (USBD_HID_HandleTypeDef*)pdev->pHID_ClassData;
|
||||
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED )
|
||||
if (pdev->dev_state == USBD_STATE_CONFIGURED && hhid)
|
||||
{
|
||||
if(hhid->state == HID_IDLE)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue