]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cfg80211: reg: remove warn_on for a normal case
authorChaitanya Tata <chaitanya.tata@bluwireless.co.uk>
Thu, 24 Jan 2019 10:43:02 +0000 (16:13 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 25 Jan 2019 09:18:02 +0000 (10:18 +0100)
If there are simulatenous queries of regdb, then there might be a case
where multiple queries can trigger request_firmware_no_wait and can have
parallel callbacks being executed asynchronously. In this scenario we
might hit the WARN_ON.

So remove the warn_on, as the code already handles multiple callbacks
gracefully.

Signed-off-by: Chaitanya Tata <chaitanya.tata@bluwireless.co.uk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/reg.c

index ecfb1a06dbb2be08cfc99028bb9817deaa5fc3a7..35399a825aed337d88dd638d12d4940ef0a5c86a 100644 (file)
@@ -1024,8 +1024,13 @@ static void regdb_fw_cb(const struct firmware *fw, void *context)
        }
 
        rtnl_lock();
-       if (WARN_ON(regdb && !IS_ERR(regdb))) {
-               /* just restore and free new db */
+       if (regdb && !IS_ERR(regdb)) {
+               /* negative case - a bug
+                * positive case - can happen due to race in case of multiple cb's in
+                * queue, due to usage of asynchronous callback
+                *
+                * Either case, just restore and free new db.
+                */
        } else if (set_error) {
                regdb = ERR_PTR(set_error);
        } else if (fw) {