Skip to content

Commit

Permalink
wireless: remove unreachable code
Browse files Browse the repository at this point in the history
The only case where intersected_rd can become non NULL is within an if. All
paths from that if return, so the end chunk has therefore squawked its
last and is no more.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Alan Cox authored and Johannes Berg committed Sep 18, 2012
1 parent 9385d04 commit f3baed5
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2193,7 +2193,6 @@ static void print_regdomain_info(const struct ieee80211_regdomain *rd)
static int __set_regdom(const struct ieee80211_regdomain *rd)
{
const struct ieee80211_regdomain *intersected_rd = NULL;
struct cfg80211_registered_device *rdev = NULL;
struct wiphy *request_wiphy;
/* Some basic sanity checks first */

Expand Down Expand Up @@ -2305,24 +2304,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
return 0;
}

if (!intersected_rd)
return -EINVAL;

rdev = wiphy_to_dev(request_wiphy);

rdev->country_ie_alpha2[0] = rd->alpha2[0];
rdev->country_ie_alpha2[1] = rd->alpha2[1];
rdev->env = last_request->country_ie_env;

BUG_ON(intersected_rd == rd);

kfree(rd);
rd = NULL;

reset_regdomains(false);
cfg80211_regdomain = intersected_rd;

return 0;
return -EINVAL;
}


Expand Down

0 comments on commit f3baed5

Please sign in to comment.