aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>2010-10-28 04:14:28 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>2010-10-28 04:14:28 +0000
commit8f1382d1f241cac7aad7bec5aa42d3a93a1c145f (patch)
tree7fc014644db44654714d83e1945970d5a0a98824
parent1200ef56b51f58505340b5af796552b04d68b0f4 (diff)
downloadsrc-8f1382d1f241cac7aad7bec5aa42d3a93a1c145f.tar.gz
src-8f1382d1f241cac7aad7bec5aa42d3a93a1c145f.zip
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
Notes
Notes: svn path=/head/; revision=214444
-rw-r--r--sys/dev/xen/blkback/blkback.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c
index 72087f5994ce..458149d5f06f 100644
--- a/sys/dev/xen/blkback/blkback.c
+++ b/sys/dev/xen/blkback/blkback.c
@@ -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);