From: Johannes Berg Date: Fri, 12 Oct 2007 19:24:07 +0000 (+0200) Subject: [PATCH] mac80211: fix set_channel regression X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=58a9ac17ed7a78958d03f3b4af107f0ef075cbed;p=deliverable%2Flinux.git [PATCH] mac80211: fix set_channel regression Adam Baker reported that the prism2 ioctl removal changed behaviour in that now the selection order was the other way around as before. New API is planned but not done yet, so for now just use the first matching channel in any mode as was previous behaviour with an unset next_mode. Signed-off-by: Johannes Berg Acked-by: Michael Wu Signed-off-by: John W. Linville --- diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index f0224c2311d2..6b4b0d5880db 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -306,9 +306,12 @@ int ieee80211_set_channel(struct ieee80211_local *local, int channel, int freq) ((chan->chan == channel) || (chan->freq == freq))) { local->oper_channel = chan; local->oper_hw_mode = mode; - set++; + set = 1; + break; } } + if (set) + break; } if (set) {