ath10k: fix supported band setup
PATCH 1/1 ath10k: fix supported band setup
This fixes a crash and a possible memleak.
Signed-off-by Michal Kazior <[email protected]>
---
This was introduced just recently.
drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +7 -4
@@ -2658,16 +2658,19 @@ int ath10k_mac_register(struct ath10k *ar) ar->hw->wiphy->bands[IEEE80211_BAND_2GHZ ] = band; } - -if (ar->phy_capability &WHAL_WLAN_11A_CAPABILITY ) { channels =kmemdup (ath10k_5ghz_channels,sizeof (ath10k_5ghz_channels),GFP_KERNEL ); -if (!channels) +if (!channels) { +if (ar->phy_capability &WHAL_WLAN_11G_CAPABILITY ) { + band = &ar->mac.sbands[IEEE80211_BAND_2GHZ ]; +kfree (band->channels); + }return -ENOMEM ; + } - band = &ar->mac.sbands[IEEE80211_BAND_2GHZ ]; + band = &ar->mac.sbands[IEEE80211_BAND_5GHZ ]; band->n_channels =ARRAY_SIZE (ath10k_5ghz_channels); band->channels = channels; band->n_bitrates = ath10k_a_rates_size;
Signature · 1 line
1.7.9.5
PATCH 1/1 ath10k: fix supported band setup
Quoted 3 lines · Michal Kazior
This fixes a crash and a possible memleak.
Signed-off-by Michal Kazior <[email protected]>
Damn, I broke this. Sorry about it. Applied, thank you for fixing my bug!
Signature · 1 line
Kalle Valo