diff options
author | Po-Hao Huang <phhuang@realtek.com> | 2022-12-02 09:15:26 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2022-12-08 17:47:58 +0300 |
commit | 8fc5d4338620b81b1b265c725b38aced8acf8d72 (patch) | |
tree | 5f20ba3510b304af03b26ebf8b535d52a6ac1665 /drivers | |
parent | d592b9f742643f07db53ac34baf6bbd3ce9478dc (diff) | |
download | linux-8fc5d4338620b81b1b265c725b38aced8acf8d72.tar.xz |
wifi: rtw89: fix unsuccessful interface_add flow
Remove according vifs from list if we couldn't set this interface up.
Otherwise the rtwvif_list could contain unreferenced objects.
Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221202061527.505668-4-pkshih@realtek.com
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/realtek/rtw89/mac80211.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtw89/mac80211.c b/drivers/net/wireless/realtek/rtw89/mac80211.c index 0c86d416b7ad..f9b95c52916b 100644 --- a/drivers/net/wireless/realtek/rtw89/mac80211.c +++ b/drivers/net/wireless/realtek/rtw89/mac80211.c @@ -125,6 +125,7 @@ static int rtw89_ops_add_interface(struct ieee80211_hw *hw, RTW89_PORT_NUM); if (rtwvif->port == RTW89_PORT_NUM) { ret = -ENOSPC; + list_del_init(&rtwvif->list); goto out; } @@ -138,6 +139,7 @@ static int rtw89_ops_add_interface(struct ieee80211_hw *hw, ret = rtw89_mac_add_vif(rtwdev, rtwvif); if (ret) { rtw89_core_release_bit_map(rtwdev->hw_port, rtwvif->port); + list_del_init(&rtwvif->list); goto out; } |