From e55594531891ed39805bf7aa0a1a9e5d408c85a5 Mon Sep 17 00:00:00 2001 From: Daniel Mangum Date: Sun, 10 Nov 2024 19:55:18 -0500 Subject: [PATCH] fix(usb_host): return ESP_ERR_NO_MEM on failed alloc in client register Fixes issue where ESP_ERR_NO_MEM was being silently discarded after cleaning up after a failed malloc in usb_host_client_register. Signed-off-by: Daniel Mangum --- components/usb/usb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/usb/usb_host.c b/components/usb/usb_host.c index b2e5ed137a..d1932e8f4d 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -698,7 +698,7 @@ alloc_err: vSemaphoreDelete(event_sem); } heap_caps_free(client_obj); - return ESP_OK; + return ret; } esp_err_t usb_host_client_deregister(usb_host_client_handle_t client_hdl)