Skip to content

Commit

Permalink
cfg80211: remove superfluous !last_request check in reg_device_remove()
Browse files Browse the repository at this point in the history
Commit 0ad8aca "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>
  • Loading branch information
Chris Wright authored and John W. Linville committed May 6, 2009
1 parent 2cfb1f5 commit 0ef9ccd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2100,14 +2100,14 @@ void reg_device_remove(struct wiphy *wiphy)

assert_cfg80211_lock();

kfree(wiphy->regd);

if (last_request)
request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);

kfree(wiphy->regd);
if (!last_request || !request_wiphy)
return;
if (request_wiphy != wiphy)
if (!request_wiphy || request_wiphy != wiphy)
return;

last_request->wiphy_idx = WIPHY_IDX_STALE;
last_request->country_ie_env = ENVIRON_ANY;
}
Expand Down

0 comments on commit 0ef9ccd

Please sign in to comment.