summaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-06-09 10:40:09 +0200
committerJohannes Berg <johannes.berg@intel.com>2016-06-09 10:41:19 +0200
commit0662799023de4be686263b0a4f4b7910999172b9 (patch)
tree95e6bef1e01e69de5b4e5fc579d6788a9b57f727 /net/wireless
parentwext: reformat struct/union declarations (diff)
downloadlinux-0662799023de4be686263b0a4f4b7910999172b9.tar.xz
linux-0662799023de4be686263b0a4f4b7910999172b9.zip
nl80211: clarify nl80211_set_reg() success path
Setting rd to NULL to avoid freeing it, just to be able to return from the function in a single place, doesn't make much sense. Return the set_regdom() return value directly. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/nl80211.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0d7db10c782f..c503e96bfd5a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5836,10 +5836,8 @@ static int nl80211_set_reg(struct sk_buff *skb, struct genl_info *info)
}
}
- r = set_regdom(rd, REGD_SOURCE_CRDA);
- /* set_regdom took ownership */
- rd = NULL;
-
+ /* set_regdom takes ownership of rd */
+ return set_regdom(rd, REGD_SOURCE_CRDA);
bad_reg:
kfree(rd);
return r;