Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06627990 authored by Johannes Berg's avatar Johannes Berg
Browse files

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: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1dad640b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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;