From 7962d54c4c59f71c751e772eb172d571a500329d 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 9e5f3feea36..50a3722cd67 100644 --- a/components/usb/usb_host.c +++ b/components/usb/usb_host.c @@ -818,7 +818,7 @@ esp_err_t usb_host_client_register(const usb_host_client_config_t *client_config 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)