aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2009-04-24 17:09:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-06 15:14:40 -0400
commit0ef9ccdd9ec7f2cf28d0605c216d853687f5291d (patch)
tree0056421d720d214ba49452d481325ce8156109e7 /net/wireless
parent2cfb1f5e20f260e6ff306ba181efee956ba48f54 (diff)
cfg80211: remove superfluous !last_request check in reg_device_remove()
Commit 0ad8acaf "cfg80211: fix NULL pointer deference in reg_device_remove()" added a check that last_request is non-NULL, rendering the 2nd check superfluous. While there, rearrange the code a bit so it's a little more straight forward. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index f38cc39fa79e..9fea910204db 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2100,14 +2100,14 @@ void reg_device_remove(struct wiphy *wiphy)
2100 2100
2101 assert_cfg80211_lock(); 2101 assert_cfg80211_lock();
2102 2102
2103 kfree(wiphy->regd);
2104
2103 if (last_request) 2105 if (last_request)
2104 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); 2106 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
2105 2107
2106 kfree(wiphy->regd); 2108 if (!request_wiphy || request_wiphy != wiphy)
2107 if (!last_request || !request_wiphy)
2108 return;
2109 if (request_wiphy != wiphy)
2110 return; 2109 return;
2110
2111 last_request->wiphy_idx = WIPHY_IDX_STALE; 2111 last_request->wiphy_idx = WIPHY_IDX_STALE;
2112 last_request->country_ie_env = ENVIRON_ANY; 2112 last_request->country_ie_env = ENVIRON_ANY;
2113} 2113}