Skip to content

Commit

Permalink
fix(usb_host): return ESP_ERR_NO_MEM on failed alloc in client register
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hasheddan committed Nov 11, 2024
1 parent ce60853 commit 7962d54
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/usb/usb_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7962d54

Please sign in to comment.