From 38e9c8dbdf3d1bff9ddc33b6d4f3554e8639aa23 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 644a5e777e..371c88e3e5 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -818,7 +818,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)