From owner-svn-src-all@FreeBSD.ORG Sun Sep 16 22:45:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20D4C106564A; Sun, 16 Sep 2012 22:45:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 083B98FC08; Sun, 16 Sep 2012 22:45:01 +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 q8GMj054098524; Sun, 16 Sep 2012 22:45:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q8GMj0Ig098522; Sun, 16 Sep 2012 22:45:00 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201209162245.q8GMj0Ig098522@svn.freebsd.org> From: Adrian Chadd Date: Sun, 16 Sep 2012 22:45:00 +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: r240574 - 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: Sun, 16 Sep 2012 22:45:01 -0000 Author: adrian Date: Sun Sep 16 22:45:00 2012 New Revision: 240574 URL: http://svn.freebsd.org/changeset/base/240574 Log: Fix a crash bug introduced in the iterate node work recently done. When resuming, the first VAP is checked for max_aid; however if there is no VAP, this results in a NULL pointer dereference and kernel panic. Modified: head/sys/net80211/ieee80211_node.c Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Sep 16 21:17:28 2012 (r240573) +++ head/sys/net80211/ieee80211_node.c Sun Sep 16 22:45:00 2012 (r240574) @@ -2245,8 +2245,16 @@ ieee80211_iterate_nodes(struct ieee80211 size_t size; int i; uint16_t max_aid; + struct ieee80211vap *vap; + + /* Overdoing it default */ + max_aid = IEEE80211_AID_MAX; + + /* Handle the case of there being no vaps just yet */ + vap = TAILQ_FIRST(&nt->nt_ic->ic_vaps); + if (vap != NULL) + max_aid = vap->iv_max_aid; - max_aid = TAILQ_FIRST(&nt->nt_ic->ic_vaps)->iv_max_aid; size = max_aid * sizeof(struct ieee80211_node *); ni_arr = (struct ieee80211_node **) malloc(size, M_80211_NODE, M_NOWAIT | M_ZERO);