Skip to contentSkip to conversation

wifi: nl80211: log for malformed chandef

PATCH New Jaewan Kim 1 participant 1 message Jan 30, 2023

Subsystems (3)
lore
Share & tools
lore

Jaewan Kim

author
#0 lore raw

PATCH 1/1 wifi: nl80211: log for malformed chandef

This change ensures consistency for returning error in nl80211_parse_chandef() by logging reasons for all EINVAL returns.

---
 net/wireless/nl80211.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
net/wireless/nl80211.c +4 -1
index 33a82ecab9d5..e12b01721bec 100644
@@ -3181,8 +3181,11 @@ int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
 	struct nlattr **attrs = info->attrs;
 	u32 control_freq;
 
-	if (!attrs[NL80211_ATTR_WIPHY_FREQ])
+	if (!attrs[NL80211_ATTR_WIPHY_FREQ]) {
+		NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ],
+				    "Frequency is missing");
 		return -EINVAL;
+	}
 
 	control_freq = MHZ_TO_KHZ(
 			nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
Signature · 1 line
2.39.1.456.gfc5497dd1b-goog