Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HUB] Prevent status request to invalid ep_num #2404

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

Ryzee119
Copy link
Contributor

@Ryzee119 Ryzee119 commented Jan 9, 2024

Describe the PR
If you disconnect a USB hub tusb clears the hub device memory (to zeros). If its a hub, during disconnect it also creates a detach event on hub port 0 to unroll the loop. Problem occurs when it processes this detach event on the now cleared hub device and requests the next hub status packet

(void) hub_edpt_status_xfer( event.connection.hub_addr );

Resulting in this request onto the hub interrupt endpoint
Queue EP 00 with 1 bytes ...

The ep_num of 0 causes some backends to process it as a control transfer instead of a interrupt transfer This was resulting in a td leak on the OHCI backend.

This PR prevents this from occuring.
As USB hub ports start from 1, this should not cause any issues under normal operation.

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thank you for the fix

@hathach hathach merged commit b7581f0 into hathach:master Jan 11, 2024
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants