Commit 06e769d
wifi: mac80211: always free skb on ieee80211_tx_prepare_skb() failure
[ Upstream commit d5ad6ab ]
ieee80211_tx_prepare_skb() has three error paths, but only two of them
free the skb. The first error path (ieee80211_tx_prepare() returning
TX_DROP) does not free it, while invoke_tx_handlers() failure and the
fragmentation check both do.
Add kfree_skb() to the first error path so all three are consistent,
and remove the now-redundant frees in callers (ath9k, mt76,
mac80211_hwsim) to avoid double-free.
Document the skb ownership guarantee in the function's kdoc.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/20260314065455.2462900-1-nbd@nbd.name
Fixes: 06be6b1 ("mac80211: add ieee80211_tx_prepare_skb() helper function")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 46c670f commit 06e769d
File tree
5 files changed
+9
-10
lines changed- drivers/net/wireless
- ath/ath9k
- mediatek/mt76
- virtual
- include/net
- net/mac80211
5 files changed
+9
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1006 | 1006 | | |
1007 | 1007 | | |
1008 | 1008 | | |
1009 | | - | |
| 1009 | + | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | 1012 | | |
| |||
1119 | 1119 | | |
1120 | 1120 | | |
1121 | 1121 | | |
1122 | | - | |
1123 | | - | |
| 1122 | + | |
1124 | 1123 | | |
1125 | | - | |
1126 | 1124 | | |
1127 | 1125 | | |
1128 | 1126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
| 66 | + | |
68 | 67 | | |
69 | | - | |
70 | 68 | | |
71 | 69 | | |
72 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3021 | 3021 | | |
3022 | 3022 | | |
3023 | 3023 | | |
3024 | | - | |
3025 | 3024 | | |
3026 | 3025 | | |
3027 | 3026 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7289 | 7289 | | |
7290 | 7290 | | |
7291 | 7291 | | |
7292 | | - | |
| 7292 | + | |
| 7293 | + | |
| 7294 | + | |
7293 | 7295 | | |
7294 | 7296 | | |
7295 | 7297 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1896 | 1896 | | |
1897 | 1897 | | |
1898 | 1898 | | |
1899 | | - | |
| 1899 | + | |
| 1900 | + | |
1900 | 1901 | | |
| 1902 | + | |
1901 | 1903 | | |
1902 | 1904 | | |
1903 | 1905 | | |
| |||
0 commit comments