Skip to content

Commit

Permalink
nl80211: clarify nl80211_set_reg() success path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Berg committed Jun 9, 2016
1 parent 1dad640 commit 0662799
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0662799

Please sign in to comment.