All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nl80211: clarify nl80211_set_reg() success path
@ 2016-06-09  8:41 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2016-06-09  8:41 UTC (permalink / raw)
  To: linux-wireless; +Cc: Arend Van Spriel, Eduardo Abinader, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 net/wireless/nl80211.c | 6 ++----
 1 file 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;
-- 
2.8.0.rc3


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-09  8:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-09  8:41 [PATCH] nl80211: clarify nl80211_set_reg() success path Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.