From: Patrik Flykt <patrik.flykt@linux.intel.com>
To: linux-wireless@vger.kernel.org, johannes@sipsolutions.net
Subject: [PATCH] mac80211_hwsim: Send alpha2 only if non-zero
Date: Fri, 21 Nov 2014 15:08:02 +0200 [thread overview]
Message-ID: <1416575282-19966-1-git-send-email-patrik.flykt@linux.intel.com> (raw)
A properly set alpha2 value consists of two chars that both contain
letters or digits. If no value is set, both chars keep their initial
value zero. Therefore do not send the alpha2 parameter to user space
if either of the characters has been left at its initial zero value.
Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
---
This is a fix for the issue Johannes noted with the patch adding
HWSIM_CMD_GET_RADIO support.
Cheers,
Patrik
drivers/net/wireless/mac80211_hwsim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index e23a8d1..d399a73 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2541,7 +2541,9 @@ static int mac80211_hwsim_get_radio(struct sk_buff *skb,
if (cb)
genl_dump_check_consistent(cb, hdr, &hwsim_genl_family);
- param.reg_alpha2 = data->alpha2;
+ if (data->alpha2[0] && data->alpha2[1])
+ param.reg_alpha2 = data->alpha2;
+
param.reg_strict = !!(data->hw->wiphy->regulatory_flags &
REGULATORY_STRICT_REG);
param.p2p_device = !!(data->hw->wiphy->interface_modes &
--
2.1.1
next reply other threads:[~2014-11-21 13:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 13:08 Patrik Flykt [this message]
2014-11-21 13:17 ` [PATCH] mac80211_hwsim: Send alpha2 only if non-zero Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416575282-19966-1-git-send-email-patrik.flykt@linux.intel.com \
--to=patrik.flykt@linux.intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).