public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211_hwsim: avoid NULL access
@ 2009-07-07  1:43 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2009-07-07  1:43 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

There's a race condition -- started can be set to true
before channel is set due to the way mac80211 callbacks
currently work (->start should probably pass the channel
we would like to have initially). For now simply add a
check to hwsim to avoid dereferencing the NULL channel
pointer.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 drivers/net/wireless/mac80211_hwsim.c |    1 +
 1 file changed, 1 insertion(+)

--- wireless-testing.orig/drivers/net/wireless/mac80211_hwsim.c	2009-07-07 03:29:38.000000000 +0200
+++ wireless-testing/drivers/net/wireless/mac80211_hwsim.c	2009-07-07 03:37:02.000000000 +0200
@@ -427,6 +427,7 @@ static bool mac80211_hwsim_tx_frame(stru
 			continue;
 
 		if (!data2->started || !hwsim_ps_rx_ok(data2, skb) ||
+		    !data->channel || !data2->channel ||
 		    data->channel->center_freq != data2->channel->center_freq ||
 		    !(data->group & data2->group))
 			continue;



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

only message in thread, other threads:[~2009-07-07  1:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-07  1:43 [PATCH] mac80211_hwsim: avoid NULL access Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox