Commit 841b351c authored by John Linville's avatar John Linville Committed by Johannes Berg

wireless: remove superfluous if statement in regulatory code

Commit eeca9fce ('cfg80211: Schedule timeout for all CRDA calls')
left behind a superfluous check after it removed some earlier code.

In reg_process_hint, the test of "treatment == REG_REQ_IGNORE ||
treatment == REG_REQ_ALREADY_SET" is superfluous because the code in the
if-then branch is identical to the code after the if statement.

Coverity CID #1295939

I also removed the unnecessary assignment of treatment in this case,
and added a comment reminding any future patch authors to ensure that
treatment is properly assigned before it is used after the switch.
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 33d8783c
...@@ -2079,10 +2079,7 @@ static void reg_process_hint(struct regulatory_request *reg_request) ...@@ -2079,10 +2079,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
reg_process_hint_core(reg_request); reg_process_hint_core(reg_request);
return; return;
case NL80211_REGDOM_SET_BY_USER: case NL80211_REGDOM_SET_BY_USER:
treatment = reg_process_hint_user(reg_request); reg_process_hint_user(reg_request);
if (treatment == REG_REQ_IGNORE ||
treatment == REG_REQ_ALREADY_SET)
return;
return; return;
case NL80211_REGDOM_SET_BY_DRIVER: case NL80211_REGDOM_SET_BY_DRIVER:
if (!wiphy) if (!wiphy)
...@@ -2099,7 +2096,9 @@ static void reg_process_hint(struct regulatory_request *reg_request) ...@@ -2099,7 +2096,9 @@ static void reg_process_hint(struct regulatory_request *reg_request)
goto out_free; goto out_free;
} }
/* This is required so that the orig_* parameters are saved */ /* This is required so that the orig_* parameters are saved.
* NOTE: treatment must be set for any case that reaches here!
*/
if (treatment == REG_REQ_ALREADY_SET && wiphy && if (treatment == REG_REQ_ALREADY_SET && wiphy &&
wiphy->regulatory_flags & REGULATORY_STRICT_REG) { wiphy->regulatory_flags & REGULATORY_STRICT_REG) {
wiphy_update_regulatory(wiphy, reg_request->initiator); wiphy_update_regulatory(wiphy, reg_request->initiator);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment