From owner-svn-src-stable-8@FreeBSD.ORG  Wed Jun 22 09:16:33 2011
Return-Path: <owner-svn-src-stable-8@FreeBSD.ORG>
Delivered-To: svn-src-stable-8@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45C281065770;
	Wed, 22 Jun 2011 09:16:33 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3542D8FC1A;
	Wed, 22 Jun 2011 09:16:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5M9GX2V041217;
	Wed, 22 Jun 2011 09:16:33 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5M9GXJd041215;
	Wed, 22 Jun 2011 09:16:33 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201106220916.p5M9GXJd041215@svn.freebsd.org>
From: Kevin Lo <kevlo@FreeBSD.org>
Date: Wed, 22 Jun 2011 09:16:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r223420 - stable/8/sys/dev/usb/wlan
X-BeenThere: svn-src-stable-8@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for only the 8-stable src tree
	<svn-src-stable-8.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8>, 
	<mailto:svn-src-stable-8-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-stable-8>
List-Post: <mailto:svn-src-stable-8@freebsd.org>
List-Help: <mailto:svn-src-stable-8-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-stable-8>, 
	<mailto:svn-src-stable-8-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 22 Jun 2011 09:16:33 -0000

Author: kevlo
Date: Wed Jun 22 09:16:32 2011
New Revision: 223420
URL: http://svn.freebsd.org/changeset/base/223420

Log:
  MFC r221199:
  Guard against default ni_chan
  
  PR:	kern/144642
  Submitted by:	Arthur Hartwig <a_hartwig at fastmaildot fm>

Modified:
  stable/8/sys/dev/usb/wlan/if_rum.c

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- stable/8/sys/dev/usb/wlan/if_rum.c	Wed Jun 22 08:55:00 2011	(r223419)
+++ stable/8/sys/dev/usb/wlan/if_rum.c	Wed Jun 22 09:16:32 2011	(r223420)
@@ -207,7 +207,7 @@ static void		rum_init(void *);
 static void		rum_stop(struct rum_softc *);
 static void		rum_load_microcode(struct rum_softc *, const uint8_t *,
 			    size_t);
-static int		rum_prepare_beacon(struct rum_softc *,
+static void		rum_prepare_beacon(struct rum_softc *,
 			    struct ieee80211vap *);
 static int		rum_raw_xmit(struct ieee80211_node *, struct mbuf *,
 			    const struct ieee80211_bpf_params *);
@@ -2118,7 +2118,7 @@ rum_load_microcode(struct rum_softc *sc,
 	rum_pause(sc, hz / 8);
 }
 
-static int
+static void
 rum_prepare_beacon(struct rum_softc *sc, struct ieee80211vap *vap)
 {
 	struct ieee80211com *ic = vap->iv_ic;
@@ -2126,9 +2126,12 @@ rum_prepare_beacon(struct rum_softc *sc,
 	struct rum_tx_desc desc;
 	struct mbuf *m0;
 
+	if (vap->iv_bss->ni_chan == IEEE80211_CHAN_ANYC)
+		return;
+
 	m0 = ieee80211_beacon_alloc(vap->iv_bss, &RUM_VAP(vap)->bo);
 	if (m0 == NULL) {
-		return ENOBUFS;
+		return;
 	}
 
 	tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_bsschan)];
@@ -2143,8 +2146,6 @@ rum_prepare_beacon(struct rum_softc *sc,
 	    m0->m_pkthdr.len);
 
 	m_freem(m0);
-
-	return 0;
 }
 
 static int