Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2009 18:39:23 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187835 - head/sys/net80211
Message-ID:  <200901281839.n0SIdNY9028853@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901281839.n0SIdNY9028853>