cfg80211: fix race on init and driver registration
authorLuis R. Rodriguez <mcgrof@qca.qualcomm.com>
Mon, 28 Nov 2011 21:47:15 +0000 (16:47 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 9 Dec 2011 16:52:45 +0000 (08:52 -0800)
commit3ed26be17352133a2dadbc4212a5d23b403b0980
treeff2cc4e01c57483a47c62c56d1d21a06b228a83d
parenta89c8adbd9813435ccc29699e3dd474c1b823058
cfg80211: fix race on init and driver registration

commit a042994dd377d86bff9446ee76151ceb6267c9ba upstream.

There is a theoretical race that if hit will trigger
a crash. The race is between when we issue the first
regulatory hint, regulatory_hint_core(), gets processed
by the workqueue and between when the first device
gets registered to the wireless core. This is not easy
to reproduce but it was easy to do so through the
regulatory simulator I have been working on. This
is a port of the fix I implemented there [1].

[1] https://github.com/mcgrof/regsim/commit/a246ccf81f059cb662eee288aa13100f631e4cc8

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/wireless/reg.c