Skip to content

Commit 90b2c3c

Browse files
jaewan-githubjmberg-intel
authored andcommitted
wifi: nl80211: return error message for malformed chandef
Add an error message to the missing frequency case to have all -EINVAL in nl80211_parse_chandef() return a better error. Signed-off-by: Jaewan Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] [rewrite commit message] Signed-off-by: Johannes Berg <[email protected]>
1 parent 08b7477 commit 90b2c3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/wireless/nl80211.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3181,8 +3181,11 @@ int nl80211_parse_chandef(struct cfg80211_registered_device *rdev,
31813181
struct nlattr **attrs = info->attrs;
31823182
u32 control_freq;
31833183

3184-
if (!attrs[NL80211_ATTR_WIPHY_FREQ])
3184+
if (!attrs[NL80211_ATTR_WIPHY_FREQ]) {
3185+
NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ],
3186+
"Frequency is missing");
31853187
return -EINVAL;
3188+
}
31863189

31873190
control_freq = MHZ_TO_KHZ(
31883191
nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));

0 commit comments

Comments
 (0)