Skip to contentSkip to conversation

cfg80211: reg: remove warn_on for a normal case

PATCH New [email protected] 1 participant 1 message Jan 24, 2019 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211: reg: remove warn_on for a normal case

From: Chaitanya Tata <[email protected]>

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.

---
 net/wireless/reg.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
net/wireless/reg.c +7 -2
index cce4c16eaaa0..dd58b9909ac9 100644
@@ -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) {
Signature · 1 line
2.17.1