svn commit: r187835 - head/sys/net80211
Sam Leffler
sam at FreeBSD.org
Wed Jan 28 10:39:24 PST 2009
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);
More information about the svn-src-head
mailing list