Skip to content

fix(host/cdc): Fix error path on usb_host_transfer_alloc() failure#462

Open
tore-espressif wants to merge 1 commit intomasterfrom
fix/cdc_memory_freeing
Open

fix(host/cdc): Fix error path on usb_host_transfer_alloc() failure#462
tore-espressif wants to merge 1 commit intomasterfrom
fix/cdc_memory_freeing

Conversation

@tore-espressif
Copy link
Copy Markdown
Collaborator

@tore-espressif tore-espressif commented Apr 2, 2026

Closes #444

Fixes error paths in CDC device opening

  1. In cdc_acm_transfers_free we now reset the freed pointers to NULL, so we avoid double free of transfers
  2. Test provided. We must call Mockusb_host_Init(); to reset the stubs from previous scenario. Catch2 does not automatically reset CMock expectations and Stubs
  3. Now we also check returned value from cdc_parse_functional_descriptors in case the device has functional descriptors but we don't have memory to save them

@tore-espressif tore-espressif added this to the cdc_acm_host 2.4.0 milestone Apr 2, 2026
@tore-espressif tore-espressif self-assigned this Apr 2, 2026
@tore-espressif tore-espressif added the Component: usb_host Issue affects usb_host component label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: usb_host Issue affects usb_host component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cdc_acm_host_open Memory allocation failure policy

1 participant