diff options
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 139d13fdc94f..537af62ec42b 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -2113,14 +2113,14 @@ void reg_device_remove(struct wiphy *wiphy) | |||
2113 | 2113 | ||
2114 | assert_cfg80211_lock(); | 2114 | assert_cfg80211_lock(); |
2115 | 2115 | ||
2116 | kfree(wiphy->regd); | ||
2117 | |||
2116 | if (last_request) | 2118 | if (last_request) |
2117 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); | 2119 | request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); |
2118 | 2120 | ||
2119 | kfree(wiphy->regd); | 2121 | if (!request_wiphy || request_wiphy != wiphy) |
2120 | if (!last_request || !request_wiphy) | ||
2121 | return; | ||
2122 | if (request_wiphy != wiphy) | ||
2123 | return; | 2122 | return; |
2123 | |||
2124 | last_request->wiphy_idx = WIPHY_IDX_STALE; | 2124 | last_request->wiphy_idx = WIPHY_IDX_STALE; |
2125 | last_request->country_ie_env = ENVIRON_ANY; | 2125 | last_request->country_ie_env = ENVIRON_ANY; |
2126 | } | 2126 | } |