mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
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>
This commit is contained in:
parent
1dad640b9e
commit
0662799023
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue