Commit d5ad6ab
wifi: mac80211: always free skb on ieee80211_tx_prepare_skb() failure
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>1 parent deb353d commit d5ad6ab
5 files changed
Lines changed: 9 additions & 10 deletions
File tree
- drivers/net/wireless
- ath/ath9k
- mediatek/mt76
- virtual
- include/net
- net/mac80211
| 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 | |
|---|---|---|---|
| |||
7407 | 7407 | | |
7408 | 7408 | | |
7409 | 7409 | | |
7410 | | - | |
| 7410 | + | |
| 7411 | + | |
| 7412 | + | |
7411 | 7413 | | |
7412 | 7414 | | |
7413 | 7415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1899 | 1899 | | |
1900 | 1900 | | |
1901 | 1901 | | |
1902 | | - | |
| 1902 | + | |
| 1903 | + | |
1903 | 1904 | | |
| 1905 | + | |
1904 | 1906 | | |
1905 | 1907 | | |
1906 | 1908 | | |
| |||
0 commit comments