Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 01:54:52 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
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
Message-ID:  <201510200154.t9K1sqMP031179@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510200154.t9K1sqMP031179>