All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: remove superfluous !last_request check in reg_device_remove()
@ 2009-04-24 21:09 Chris Wright
  0 siblings, 0 replies; only message in thread
From: Chris Wright @ 2009-04-24 21:09 UTC (permalink / raw)
  To: Luis R. Rodriguez
  Cc: Quentin Armitage, John W. Linville, linux-wireless, johannes

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>
---
 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 6c1993d..ab995b7 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2099,14 +2099,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;
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-24 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-24 21:09 [PATCH] cfg80211: remove superfluous !last_request check in reg_device_remove() Chris Wright

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.