From owner-svn-src-all@FreeBSD.ORG Wed Jan 28 18:39:24 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0107E10656E4; Wed, 28 Jan 2009 18:39:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DEDAC8FC13; Wed, 28 Jan 2009 18:39:23 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0SIdNOM028854; Wed, 28 Jan 2009 18:39:23 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0SIdNY9028853; Wed, 28 Jan 2009 18:39:23 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200901281839.n0SIdNY9028853@svn.freebsd.org> From: Sam Leffler Date: Wed, 28 Jan 2009 18:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187835 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 18:39:24 -0000 Author: sam Date: Wed Jan 28 18:39:23 2009 New Revision: 187835 URL: http://svn.freebsd.org/changeset/base/187835 Log: add an assert to verify the number of channels returned by ic_getradiocaps correlates with the size of the channel array passed down might want to promote this to be always present to catch for driver errors Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Wed Jan 28 18:37:46 2009 (r187834) +++ head/sys/net80211/ieee80211_ioctl.c Wed Jan 28 18:39:23 2009 (r187835) @@ -715,6 +715,8 @@ ieee80211_ioctl_getdevcaps(struct ieee80 dc->dc_htcaps = ic->ic_htcaps; ci = &dc->dc_chaninfo; ic->ic_getradiocaps(ic, maxchans, &ci->ic_nchans, ci->ic_chans); + KASSERT(ci->ic_nchans <= maxchans, + ("nchans %d maxchans %d", ci->ic_nchans, maxchans)); ieee80211_sort_channels(ci->ic_chans, ci->ic_nchans); error = copyout(dc, ireq->i_data, IEEE80211_DEVCAPS_SPACE(dc)); free(dc, M_TEMP);