From 53e81732f6a380df070414676f5fb538207d0f4b Mon Sep 17 00:00:00 2001 From: jflyper Date: Mon, 8 Jul 2019 14:19:30 +0900 Subject: [PATCH] [G4][LIB][USB] Middlewares change: Fix memory corruption --- .../ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c b/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c index 8c93f1ba9..b21bcbaf3 100755 --- a/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c +++ b/lib/main/STM32G4/Middlewares/ST/STM32_USB_Device_Library/Class/HID/Src/usbd_hid.c @@ -531,7 +531,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) {