Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wireless: remove unreachable code

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>

authored by

Alan Cox and committed by
Johannes Berg
f3baed51 9385d04f

+1 -19
+1 -19
net/wireless/reg.c
··· 2193 2193 static int __set_regdom(const struct ieee80211_regdomain *rd) 2194 2194 { 2195 2195 const struct ieee80211_regdomain *intersected_rd = NULL; 2196 - struct cfg80211_registered_device *rdev = NULL; 2197 2196 struct wiphy *request_wiphy; 2198 2197 /* Some basic sanity checks first */ 2199 2198 ··· 2304 2305 return 0; 2305 2306 } 2306 2307 2307 - if (!intersected_rd) 2308 - return -EINVAL; 2309 - 2310 - rdev = wiphy_to_dev(request_wiphy); 2311 - 2312 - rdev->country_ie_alpha2[0] = rd->alpha2[0]; 2313 - rdev->country_ie_alpha2[1] = rd->alpha2[1]; 2314 - rdev->env = last_request->country_ie_env; 2315 - 2316 - BUG_ON(intersected_rd == rd); 2317 - 2318 - kfree(rd); 2319 - rd = NULL; 2320 - 2321 - reset_regdomains(false); 2322 - cfg80211_regdomain = intersected_rd; 2323 - 2324 - return 0; 2308 + return -EINVAL; 2325 2309 } 2326 2310 2327 2311