From owner-p4-projects@FreeBSD.ORG Tue Feb 19 23:36:19 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 31AB516A511; Tue, 19 Feb 2008 23:36:18 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BFEC16A46B for ; Tue, 19 Feb 2008 23:36:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5F0EF13C45B for ; Tue, 19 Feb 2008 23:36:18 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m1JNaIhX037537 for ; Tue, 19 Feb 2008 23:36:18 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m1JNaIlb037534 for perforce@freebsd.org; Tue, 19 Feb 2008 23:36:18 GMT (envelope-from sam@freebsd.org) Date: Tue, 19 Feb 2008 23:36:18 GMT Message-Id: <200802192336.m1JNaIlb037534@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 135759 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2008 23:36:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=135759 Change 135759 by sam@sam_ebb on 2008/02/19 23:35:51 sort_channels expects there are channels; avoid calling it with an empty table Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_regdomain.c#7 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_regdomain.c#7 (text+ko) ==== @@ -172,6 +172,7 @@ uint8_t *aa = a; uint8_t *ai, *t; + KASSERT(n > 0, ("no channels")); for (ai = aa+size; --n >= 1; ai += size) for (t = ai; t > aa; t -= size) { uint8_t *u = t - size; @@ -191,7 +192,8 @@ void ieee80211_sort_channels(struct ieee80211_channel chans[], int nchans) { - sort_channels(chans, nchans, sizeof(struct ieee80211_channel)); + if (nchans > 0) + sort_channels(chans, nchans, sizeof(struct ieee80211_channel)); } /*