yushuailong opened a new pull request, #21460: URL: https://github.com/apache/nuttx/pull/21460
## Summary Fix standard GET_INTERFACE and SET_INTERFACE requests bypassing the configuration and direction checks in the USB composite framework. The standard-request dispatch currently accepts only device recipients. Valid GET_INTERFACE and SET_INTERFACE requests use an interface recipient, so their existing switch cases are unreachable. These requests instead fall through to the generic forwarding path and reach the component driver without the framework's checks. Route these two standard interface requests through their existing cases and correct the inverted GET_INTERFACE configuration comparison. Both requests are forwarded only when a configuration is active and their transfer direction is valid. The first commit fixes existing whitespace errors in composite.c so the full-file style check passes. The second commit contains the unctional fix. ## Impact - Applies to configurations using the USB composite device framework. - Rejects standard GET_INTERFACE and SET_INTERFACE requests before configuration and when their transfer direction is invalid. - Continues to forward valid requests after configuration to the corresponding component driver. - Preserves forwarding of other interface requests, including interface descriptors and class/vendor requests. - No API, Kconfig or USB descriptor changes. ## Testing ## Testing Platform: STM32H7, USB OTG FS. Build host: macOS arm64. Toolchain: Arm GNU Toolchain 14.2.Rel1, arm-none-eabi-gcc 14.2.1. Build system: CMake and Ninja. Built and flashed firmware containing this fix, with USB CDC ACM and DFU Runtime enabled in the composite device configuration. Verified on hardware: - USB composite device enumeration completed successfully. - CDC ACM console input and output worked correctly. - The DFU Runtime interface was detected correctly. No regressions were observed in these tests. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
