aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2014-11-21 08:08:02 -0500
committerJohannes Berg <johannes.berg@intel.com>2014-11-21 08:18:01 -0500
commitb0ad5e8b4905d2398702e1dde033bce9c2c0fcad (patch)
tree0c5c07c10dd0a10ce4ba6f2c5633bd93eab2f284 /drivers/net/wireless/mac80211_hwsim.c
parent75769c80e381653994293b5aa5a8cfec50088f9f (diff)
mac80211_hwsim: Send alpha2 only if non-zero
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> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index e23a8d14578a..d399a7367ce9 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,
2541 if (cb) 2541 if (cb)
2542 genl_dump_check_consistent(cb, hdr, &hwsim_genl_family); 2542 genl_dump_check_consistent(cb, hdr, &hwsim_genl_family);
2543 2543
2544 param.reg_alpha2 = data->alpha2; 2544 if (data->alpha2[0] && data->alpha2[1])
2545 param.reg_alpha2 = data->alpha2;
2546
2545 param.reg_strict = !!(data->hw->wiphy->regulatory_flags & 2547 param.reg_strict = !!(data->hw->wiphy->regulatory_flags &
2546 REGULATORY_STRICT_REG); 2548 REGULATORY_STRICT_REG);
2547 param.p2p_device = !!(data->hw->wiphy->interface_modes & 2549 param.p2p_device = !!(data->hw->wiphy->interface_modes &