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 <georgedanielmangum@gmail.com>
This commit is contained in:
Daniel Mangum 2024-11-10 19:55:18 -05:00 committed by Tomas Rezucha
parent 94250f0521
commit 669565477e

View File

@ -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)