Skip to content

Commit feafe59

Browse files
kvaloKalle Valo
authored andcommitted
wifi: ath11k: use RCU when accessing struct inet6_dev::ac_list
Commit c371893 ("ipv6: anycast: complete RCU handling of struct ifacaddr6") converted struct inet6_dev::ac_list to use RCU but missed that ath11k also accesses this list. Now sparse warns: drivers/net/wireless/ath/ath11k/mac.c:9145:21: warning: incorrect type in assignment (different address spaces) drivers/net/wireless/ath/ath11k/mac.c:9145:21: expected struct ifacaddr6 *ifaca6 drivers/net/wireless/ath/ath11k/mac.c:9145:21: got struct ifacaddr6 [noderef] __rcu *ac_list drivers/net/wireless/ath/ath11k/mac.c:9145:53: warning: incorrect type in assignment (different address spaces) drivers/net/wireless/ath/ath11k/mac.c:9145:53: expected struct ifacaddr6 *ifaca6 drivers/net/wireless/ath/ath11k/mac.c:9145:53: got struct ifacaddr6 [noderef] __rcu *aca_next Fix it by using rtnl_dereference(). Also add a note that read_lock_bh() calls rcu_read_lock() which I was not aware of. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.37 Fixes: c371893 ("ipv6: anycast: complete RCU handling of struct ifacaddr6") Signed-off-by: Kalle Valo <[email protected]> Acked-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://msgid.link/[email protected]
1 parent 9ef3699 commit feafe59

File tree

1 file changed

+3
-1
lines changed
  • drivers/net/wireless/ath/ath11k

1 file changed

+3
-1
lines changed

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9020,6 +9020,7 @@ static void ath11k_mac_op_ipv6_changed(struct ieee80211_hw *hw,
90209020
offload = &arvif->arp_ns_offload;
90219021
count = 0;
90229022

9023+
/* Note: read_lock_bh() calls rcu_read_lock() */
90239024
read_lock_bh(&idev->lock);
90249025

90259026
memset(offload->ipv6_addr, 0, sizeof(offload->ipv6_addr));
@@ -9050,7 +9051,8 @@ static void ath11k_mac_op_ipv6_changed(struct ieee80211_hw *hw,
90509051
}
90519052

90529053
/* get anycast address */
9053-
for (ifaca6 = idev->ac_list; ifaca6; ifaca6 = ifaca6->aca_next) {
9054+
for (ifaca6 = rcu_dereference(idev->ac_list); ifaca6;
9055+
ifaca6 = rcu_dereference(ifaca6->aca_next)) {
90549056
if (count >= ATH11K_IPV6_MAX_COUNT)
90559057
goto generate;
90569058

0 commit comments

Comments
 (0)