Skip to contentSkip to conversation

cfg80211: switch from WARN() to pr_warn() in is_user_regdom_saved()

PATCH In review Rustam Kovhaev 2 participants 3 messages Aug 4, 2020 – Aug 19, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cfg80211: switch from WARN() to pr_warn() in is_user_regdom_saved()

this warning can be triggered by userspace, so it should not cause a panic if panic_on_warn is set

---
 net/wireless/reg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/wireless/reg.c +3 -3
index 0d74a31ef0ab..86355938ae8f 100644
@@ -415,10 +415,10 @@ static bool is_user_regdom_saved(void)
 		return false;
 
 	/* This would indicate a mistake on the design */
-	if (WARN(!is_world_regdom(user_alpha2) && !is_an_alpha2(user_alpha2),
-		 "Unexpected user alpha2: %c%c\n",
-		 user_alpha2[0], user_alpha2[1]))
+	if (!is_world_regdom(user_alpha2) && !is_an_alpha2(user_alpha2)) {
+		pr_warn("Unexpected user_alpha2: %c%c\n", user_alpha2[0], user_alpha2[1]);
 		return false;
+	}
 
 	return true;
 }
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 2 lines · Rustam Kovhaev

this warning can be triggered by userspace, so it should not cause a panic if panic_on_warn is set

This is incorrect, it just addresses a particular symptom. I'll make a proper fix.

johannes

#2 lore raw
Quoted 6 lines · Johannes Berg
Quoted 2 lines · Rustam Kovhaev

this warning can be triggered by userspace, so it should not cause a panic if panic_on_warn is set

This is incorrect, it just addresses a particular symptom. I'll make a proper fix.

tyvm!