Commit eb46640
wifi: mt76: Fix memory leak after mt76_connac_mcu_alloc_sta_req()
[ Upstream commit c41075c ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 2d8e005 commit eb46640
3 files changed
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
1298 | | - | |
| 1298 | + | |
| 1299 | + | |
1299 | 1300 | | |
| 1301 | + | |
1300 | 1302 | | |
1301 | 1303 | | |
1302 | 1304 | | |
| |||
1309 | 1311 | | |
1310 | 1312 | | |
1311 | 1313 | | |
1312 | | - | |
| 1314 | + | |
| 1315 | + | |
1313 | 1316 | | |
| 1317 | + | |
1314 | 1318 | | |
1315 | 1319 | | |
1316 | 1320 | | |
| |||
2764 | 2768 | | |
2765 | 2769 | | |
2766 | 2770 | | |
2767 | | - | |
| 2771 | + | |
| 2772 | + | |
2768 | 2773 | | |
| 2774 | + | |
2769 | 2775 | | |
2770 | 2776 | | |
2771 | | - | |
| 2777 | + | |
| 2778 | + | |
2772 | 2779 | | |
| 2780 | + | |
2773 | 2781 | | |
2774 | 2782 | | |
2775 | 2783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1765 | 1765 | | |
1766 | 1766 | | |
1767 | 1767 | | |
1768 | | - | |
| 1768 | + | |
| 1769 | + | |
1769 | 1770 | | |
| 1771 | + | |
1770 | 1772 | | |
1771 | 1773 | | |
1772 | 1774 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1288 | 1288 | | |
1289 | 1289 | | |
1290 | 1290 | | |
1291 | | - | |
| 1291 | + | |
| 1292 | + | |
1292 | 1293 | | |
| 1294 | + | |
1293 | 1295 | | |
1294 | 1296 | | |
1295 | 1297 | | |
| |||
0 commit comments