]> git.baikalelectronics.ru Git - kernel.git/commit
regulatory: fix reg_is_valid_request handling
authorJohannes Berg <johannes.berg@intel.com>
Mon, 3 Dec 2012 23:48:59 +0000 (00:48 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 3 Jan 2013 12:01:28 +0000 (13:01 +0100)
commita204563190bd4a2477296e5915bf5c0b1214f2e4
tree15b54b8dd9d5eef07e8a9366b3f9e391043499f1
parent0011ccc1602d505192acdea3068d47d3c8d2c7e6
regulatory: fix reg_is_valid_request handling

There's a bug with the world regulatory domain, it
can be updated any time which is different from all
other regdomains that can only be updated once after
a request for them. Fix this by adding a check for
"processed" to the reg_is_valid_request() function
and clear that when doing a request.

While looking at this I also found another locking
bug, last_request is protected by the reg_mutex not
the cfg80211_mutex so the code in nl80211 is racy.
Remove that code as it only tries to prevent an
allocation in an error case, which isn't necessary.
Then the function can also become static and locking
in nl80211 can have a smaller scope.

Also change __set_regdom() to do the checks earlier
and not different for world/other regdomains.

Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c
net/wireless/reg.c
net/wireless/reg.h