Commit 0ec4926
wifi: mt76: mt7925: fix incorrect TLV length in CLC command
[ Upstream commit 62e037aa8cf5a69b7ea63336705a35c897b9db2b ]
The previous implementation of __mt7925_mcu_set_clc() set the TLV length
field (.len) incorrectly during CLC command construction. The length was
initialized as sizeof(req) - 4, regardless of the actual segment length.
This could cause the WiFi firmware to misinterpret the command payload,
resulting in command execution errors.
This patch moves the TLV length assignment to after the segment is
selected, and sets .len to sizeof(req) + seg->len - 4, matching the
actual command content. This ensures the firmware receives the
correct TLV length and parses the command properly.
Fixes: c948b5d ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Cc: stable@vger.kernel.org
Signed-off-by: Quan Zhou <quan.zhou@mediatek.com>
Acked-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/f56ae0e705774dfa8aab3b99e5bbdc92cd93523e.1772011204.git.quan.zhou@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 113c0650ce7d81608eca7b2a0e539208102d0622)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent 4711deb commit 0ec4926
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3201 | 3201 | | |
3202 | 3202 | | |
3203 | 3203 | | |
3204 | | - | |
3205 | 3204 | | |
3206 | 3205 | | |
3207 | 3206 | | |
| |||
3229 | 3228 | | |
3230 | 3229 | | |
3231 | 3230 | | |
| 3231 | + | |
3232 | 3232 | | |
3233 | 3233 | | |
3234 | 3234 | | |
| |||
0 commit comments