os_intfs: make the rx_ampdu sz_limit branch chain exhaustive - #47
Merged
Conversation
gcc W=2 cannot prove the else-if chain covers i == 3 and reports sz_limit maybe-uninitialized; make the last branch a plain else. No behavior change (i < 4).
… to 4ss Keep the i == 3 arm explicit; an out-of-range index (possible only via a future edit of the loop) trips rtw_warn_on() and skips the row instead of silently reusing the 4ss limits.
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.
gcc W=2 reports sz_limit maybe-uninitialized in rtw_regsty_init_rx_ampdu_sz_limit (os_intfs.c:1096, the site #41 left open): it cannot prove the else-if chain covers i == 3. Keep the chain explicit and add a defensive final else — rtw_warn_on(1) + continue: an out-of-range index (possible only via a future edit of the loop) warns and skips the row instead of dereferencing an uninitialised pointer.
Verified: os_intfs.o under W=12 — maybe-uninitialized 2 -> 0, the file's other warning classes untouched. Squash on merge.