Repository navigation
RTL8189FS: fix compile on Linux 7.3 - #146
Merged
Merged
Conversation
(cherry picked from commit a797e3a)
Before 7.3, cfg80211_rtw_remain_on_channel() and cfg80211_rtw_mgmt_tx() receive `u64 *cookie` as an output parameter: cfg80211 passes an uninitialised stack variable and reads back whatever the driver stores there. The 7.3 compatibility rework generates the value into local roc_cookie / tx_cookie variables and never writes it back, so on every kernel below 7.3 nl80211 reports a garbage cookie to userspace and the later cancel_remain_on_channel() / mgmt_tx_cancel_wait() lookups no longer match the ROC or mgmt-TX entry. Write the generated value back through the pointer on the pre-7.3 path. The compiler gives no diagnostic for this, so the driver builds clean while P2P and mgmt-TX cancellation silently break. Both cookie variables move up into the declaration block, so that the driver keeps building on kernels that still use -std=gnu89, where a declaration after a statement is not accepted. (cherry picked from commit 8f5799f)
This was referenced Sep 11, 2026
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.
Linux 7.3 changed the cfg80211 remain_on_channel() and mgmt_tx() ops to take the cookie by value (cfg80211 assigns it); the driver still stores it through the u64 pointer, so cfg80211_rtw_ops fails to compile on 7.3.
Two commits taken from the Armbian fork with their authorship: EvilOlaf's 7.3 compat, plus the follow-up that keeps the cookie output parameter on kernels before 7.3 (his version dropped the *cookie store, which left nl80211's cookie uninitialised on <= 7.2).
Compile tested against 7.2.4 and 7.3-rc2 (arm64, gcc 14.2): base fails on 7.3 with two initialisation errors in cfg80211_rtw_ops, this branch builds on both with no new warnings.