cfg80211: fix race between sysfs and cfg80211
authorMaxime Bizon <mbizon@freebox.fr>
Wed, 21 Jul 2010 15:21:38 +0000 (17:21 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 21 Jul 2010 19:13:42 +0000 (15:13 -0400)
commit5a652052fedbd7869572c757dd2ffc2ed420c69d
treec147fefc826f74e84a887a069235c22eadc0f561
parentacd82aa868c2133149370c18d85f8005fbf5611e
cfg80211: fix race between sysfs and cfg80211

device_add() is called before adding the phy to the cfg80211 device
list.

So if a userspace program uses sysfs uevents to detect new phy
devices, and queries nl80211 to get phy info, it can get ENODEV even
though the phy exists in sysfs.

An easy workaround is to hold the cfg80211 mutex until the phy is
present in sysfs/cfg80211/debugfs.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/core.c