ch348: address remaining v9 review and robustness issues - #1
Open
dormancygrace wants to merge 5 commits into
Open
ch348: address remaining v9 review and robustness issues#1dormancygrace wants to merge 5 commits into
dormancygrace wants to merge 5 commits into
Conversation
The receive callbacks access fixed and variable-length records directly in the URB buffer. A short final record can make the status path read fields beyond actual_length and make the serial path pass stale bytes to the tty layer. Require a complete record header and payload before processing either receive stream. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Returning early for B0 avoids sending an unsupported zero baud rate and prevents a division by zero while calculating the receive timeout. Also correct the stop-bit constant names and assignments. The vendor protocol uses 0x00 for one stop bit and 0x02 for two stop bits. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
The write callback deliberately leaves tx_bytes untouched when a write URB is killed. Clear it after killing the URB so a later open does not inherit stale pending-byte accounting. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Reject devices whose endpoint buffers cannot hold the corresponding protocol header. This prevents the serial transmit length calculation from underflowing on malformed descriptors. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
Use lower-case messages and consistent wording as requested during the v8 review. Signed-off-by: Gleb Pesin <dormancygrace@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series addresses issues found while checking the v9 preparation branch
against Johan's v8 review and the vendor driver's receive-path fixes.
Validation:
checkpatch.pl --strictwith 0 errors and 0 warnings.W=1succeeds against Ubuntu6.8.0-138-genericheaders.documented in
dormancygrace/ch9344-dkms.
Hardware testing of this exact series on the CH348Q is pending re-verification
of the test host's changed SSH host key.