From owner-svn-src-all@FreeBSD.ORG Mon Jan 26 16:26:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37972F6B; Mon, 26 Jan 2015 16:26:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24024A4F; Mon, 26 Jan 2015 16:26:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0QGQUID032992; Mon, 26 Jan 2015 16:26:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0QGQTUr032990; Mon, 26 Jan 2015 16:26:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201501261626.t0QGQTUr032990@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Jan 2015 16:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r277759 - in head/sys: dev/cxgbe kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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: Mon, 26 Jan 2015 16:26:30 -0000 Author: jhb Date: Mon Jan 26 16:26:28 2015 New Revision: 277759 URL: https://svnweb.freebsd.org/changeset/base/277759 Log: Fix a couple of panics when detaching from a cxgbe/cxl interface that was never brought up: - Allow NULL to be passed to sglist_free(). - Don't try to stop an interface that was never fully initialized. Reviewed by: np Modified: head/sys/dev/cxgbe/t4_main.c head/sys/kern/subr_sglist.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jan 26 15:47:08 2015 (r277758) +++ head/sys/dev/cxgbe/t4_main.c Mon Jan 26 16:26:28 2015 (r277759) @@ -3292,6 +3292,12 @@ cxgbe_uninit_synchronized(struct port_in ASSERT_SYNCHRONIZED_OP(sc); + if (!(pi->flags & PORT_INIT_DONE)) { + KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING), + ("uninited port is running")); + return (0); + } + /* * Disable the VI so that all its data in either direction is discarded * by the MPS. Leave everything else (the queues, interrupts, and 1Hz Modified: head/sys/kern/subr_sglist.c ============================================================================== --- head/sys/kern/subr_sglist.c Mon Jan 26 15:47:08 2015 (r277758) +++ head/sys/kern/subr_sglist.c Mon Jan 26 16:26:28 2015 (r277759) @@ -216,6 +216,9 @@ void sglist_free(struct sglist *sg) { + if (sg == NULL) + return; + if (refcount_release(&sg->sg_refs)) free(sg, M_SGLIST); }