Skip to content

Commit

Permalink
mac80211: work around a race condition on detecting a phy while bring…
Browse files Browse the repository at this point in the history
…ing it up

When reloading modules and running wifi, a phy can sometimes be renamed
while in the middle of a hotplug call that tries to detect new phys
This can lead to bogus wifi-device sections being created

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Dec 16, 2022
1 parent 92acd9f commit 133a1e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package/kernel/mac80211/files/lib/wifi/mac80211.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ detect_mac80211() {

path="$(iwinfo nl80211 path "$dev")"
macaddr="$(cat /sys/class/ieee80211/${dev}/macaddress)"

# work around phy rename related race condition
[ -n "$path" -o -n "$macaddr" ] || continue

board_dev=
fallback_board_dev=
json_for_each_item check_board_phy wlan
Expand Down

0 comments on commit 133a1e2

Please sign in to comment.