From owner-svn-src-all@freebsd.org Tue Oct 20 01:54:53 2015 Return-Path: Delivered-To: svn-src-all@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 CD457A19D4B; Tue, 20 Oct 2015 01:54:53 +0000 (UTC) (envelope-from cem@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 9765C1184; Tue, 20 Oct 2015 01:54:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9K1sqP5031180; Tue, 20 Oct 2015 01:54:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9K1sqMP031179; Tue, 20 Oct 2015 01:54:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201510200154.t9K1sqMP031179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 20 Oct 2015 01:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289617 - head/sys/dev/ntb/ntb_hw 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.20 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: Tue, 20 Oct 2015 01:54:53 -0000 Author: cem Date: Tue Oct 20 01:54:52 2015 New Revision: 289617 URL: https://svnweb.freebsd.org/changeset/base/289617 Log: NTB: Clean up safely if attach fails early Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c Modified: head/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw.c Tue Oct 20 01:54:43 2015 (r289616) +++ head/sys/dev/ntb/ntb_hw/ntb_hw.c Tue Oct 20 01:54:52 2015 (r289617) @@ -543,7 +543,8 @@ ntb_detach(device_t device) ntb = DEVICE2SOFTC(device); - ntb_db_set_mask(ntb, ntb->db_valid_mask); + if (ntb->self_reg != NULL) + ntb_db_set_mask(ntb, ntb->db_valid_mask); callout_drain(&ntb->heartbeat_timer); callout_drain(&ntb->lr_timer); if (ntb->type == NTB_XEON) @@ -1108,7 +1109,8 @@ static void ntb_teardown_xeon(struct ntb_softc *ntb) { - ntb_link_disable(ntb); + if (ntb->reg != NULL) + ntb_link_disable(ntb); } static void