1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

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
This commit is contained in:
Justin T. Gibbs 2010-10-28 04:14:28 +00:00
parent 1200ef56b5
commit 8f1382d1f2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=214444

View File

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