]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit24668f0d4720b798025870ff1d86f5b8088476aa
treec147fefc826f74e84a887a069235c22eadc0f561
parent1a18884ca87349bbcb15dab1bb07a01450f9b66d
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