svn commit: r214444 - head/sys/dev/xen/blkback

Justin T. Gibbs gibbs at FreeBSD.org
Thu Oct 28 04:14:29 UTC 2010


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);


More information about the svn-src-head mailing list