Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Oct 2010 04:14:29 +0000 (UTC)
From:      "Justin T. Gibbs" <gibbs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r214444 - head/sys/dev/xen/blkback
Message-ID:  <201010280414.o9S4ETeD061201@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gibbs
Date: Thu Oct 28 04:14:28 2010
New Revision: 214444
URL: http://svn.freebsd.org/changeset/base/214444

Log:
  sys/dev/xen/blkback/blkback.c:
  	In xbb_detach() only perform cleanup of our taskqueue and
  	device statistics structures if they have been initialized.
  	This avoids a panic when xbb_detach() is called on a partially
  	initialized device instance, due to an early failure in
  	attach.
  
  Sponsored by:	Spectra Logic Corporation

Modified:
  head/sys/dev/xen/blkback/blkback.c

Modified: head/sys/dev/xen/blkback/blkback.c
==============================================================================
--- head/sys/dev/xen/blkback/blkback.c	Thu Oct 28 02:59:25 2010	(r214443)
+++ head/sys/dev/xen/blkback/blkback.c	Thu Oct 28 04:14:28 2010	(r214444)
@@ -2827,8 +2827,11 @@ xbb_detach(device_t dev)
 
 	DPRINTF("\n");
 
-	taskqueue_free(xbb->io_taskqueue);
-	devstat_remove_entry(xbb->xbb_stats);
+	if (xbb->io_taskqueue != NULL)
+		taskqueue_free(xbb->io_taskqueue);
+
+	if (xbb->xbb_stats != NULL)
+		devstat_remove_entry(xbb->xbb_stats);
 
 	xbb_close_backend(xbb);
 	xbb_free_communication_mem(xbb);



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