From owner-svn-src-stable@freebsd.org Sun Mar 20 05:01:41 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9644ACEB22; Sun, 20 Mar 2016 05:01:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A88F7B98; Sun, 20 Mar 2016 05:01:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2K51e0o069418; Sun, 20 Mar 2016 05:01:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2K51eH0069415; Sun, 20 Mar 2016 05:01:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603200501.u2K51eH0069415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 20 Mar 2016 05:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r297059 - in stable/10/sys: dev/cxgbe kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 05:01:42 -0000 Author: np Date: Sun Mar 20 05:01:40 2016 New Revision: 297059 URL: https://svnweb.freebsd.org/changeset/base/297059 Log: MFC r277759 (by jhb@) 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. PR: 208136 Modified: stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/kern/subr_sglist.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sun Mar 20 03:54:57 2016 (r297058) +++ stable/10/sys/dev/cxgbe/t4_main.c Sun Mar 20 05:01:40 2016 (r297059) @@ -3250,6 +3250,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: stable/10/sys/kern/subr_sglist.c ============================================================================== --- stable/10/sys/kern/subr_sglist.c Sun Mar 20 03:54:57 2016 (r297058) +++ stable/10/sys/kern/subr_sglist.c Sun Mar 20 05:01:40 2016 (r297059) @@ -216,6 +216,9 @@ void sglist_free(struct sglist *sg) { + if (sg == NULL) + return; + if (refcount_release(&sg->sg_refs)) free(sg, M_SGLIST); }