From 669565477e62e9d233326c14d9f8b437628da891 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 e0182d5660..929126b824 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -691,7 +691,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)