aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);