forked from espressif/esp-idf
Merge branch 'fix/usb-host-device-close-err-give-semaphore_v5.1' into 'release/v5.1'
fix(usb_host): Give semaphore on attempted close of non-opened device (backport v5.1) See merge request espressif/esp-idf!38209
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
@@ -884,10 +884,9 @@ esp_err_t usb_host_device_close(usb_host_client_handle_t client_hdl, usb_device_
|
||||
HOST_ENTER_CRITICAL();
|
||||
uint8_t dev_addr;
|
||||
ESP_ERROR_CHECK(usbh_dev_get_addr(dev_hdl, &dev_addr));
|
||||
HOST_CHECK_FROM_CRIT(_check_client_opened_device(client_obj, dev_addr), ESP_ERR_NOT_FOUND);
|
||||
if (!_check_client_opened_device(client_obj, dev_addr)) {
|
||||
// Client never opened this device
|
||||
ret = ESP_ERR_INVALID_STATE;
|
||||
ret = ESP_ERR_NOT_FOUND;
|
||||
HOST_EXIT_CRITICAL();
|
||||
goto exit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user