Commit c9ba7ee
wifi: mt76: Fix memory leak after mt76_connac_mcu_alloc_sta_req()
mainline inclusion
from mainline-v7.1-rc1
category: bugfix
mt76_connac_mcu_alloc_sta_req() allocates an skb which is expected to
be freed eventually by mt76_mcu_skb_send_msg(). However, currently if
an intermediate function fails before sending, the allocated skb is
leaked.
Specifically, mt76_connac_mcu_sta_wed_update() and
mt76_connac_mcu_sta_key_tlv() may fail, leading to an immediate memory
leak in the error path.
Fix this by explicitly freeing the skb in these error paths.
Commit 7c0f63f ("wifi: mt76: mt7996: fix memory leak on
mt7996_mcu_sta_key_tlv error") made a similar change.
Compile tested only. Issue found using a prototype static analysis tool
and code review.
Fixes: d1369e5 ("wifi: mt76: connac: introduce mt76_connac_mcu_sta_wed_update utility routine")
Fixes: 6683d98 ("mt76: connac: move mt76_connac_mcu_add_key in connac module")
Fixes: 4f831d1 ("wifi: mt76: mt7915: enable WED RX support")
Fixes: c948b5d ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Link: https://patch.msgid.link/20260116144919.1482558-1-zilin@seu.edu.cn
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit c41075ce8cf05ed8c0e7b7efef000dce548ffc42)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>1 parent 93fa5a1 commit c9ba7ee
3 files changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1283 | 1283 | | |
1284 | 1284 | | |
1285 | 1285 | | |
1286 | | - | |
| 1286 | + | |
| 1287 | + | |
1287 | 1288 | | |
| 1289 | + | |
1288 | 1290 | | |
1289 | 1291 | | |
1290 | 1292 | | |
| |||
1297 | 1299 | | |
1298 | 1300 | | |
1299 | 1301 | | |
1300 | | - | |
| 1302 | + | |
| 1303 | + | |
1301 | 1304 | | |
| 1305 | + | |
1302 | 1306 | | |
1303 | 1307 | | |
1304 | 1308 | | |
| |||
2689 | 2693 | | |
2690 | 2694 | | |
2691 | 2695 | | |
2692 | | - | |
| 2696 | + | |
| 2697 | + | |
2693 | 2698 | | |
| 2699 | + | |
2694 | 2700 | | |
2695 | 2701 | | |
2696 | | - | |
| 2702 | + | |
| 2703 | + | |
2697 | 2704 | | |
| 2705 | + | |
2698 | 2706 | | |
2699 | 2707 | | |
2700 | 2708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | | - | |
| 1718 | + | |
| 1719 | + | |
1719 | 1720 | | |
| 1721 | + | |
1720 | 1722 | | |
1721 | 1723 | | |
1722 | 1724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | | - | |
| 1119 | + | |
| 1120 | + | |
1120 | 1121 | | |
| 1122 | + | |
1121 | 1123 | | |
1122 | 1124 | | |
1123 | 1125 | | |
| |||
0 commit comments