Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as

it is indirectly a d_close method.

Prompted by:	kib
Reviewed by:	mav
MFC after:	2 weeks
This commit is contained in:
Matthew D Fleming 2010-09-20 19:42:14 +00:00
parent 4089cc8aa1
commit 81059816c0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212926

View File

@ -169,7 +169,11 @@ passcleanup(struct cam_periph *periph)
xpt_print(periph->path, "removing device entry\n");
devstat_remove_entry(softc->device_stats);
cam_periph_unlock(periph);
destroy_dev(softc->dev);
/*
* passcleanup() is indirectly a d_close method via passclose,
* so using destroy_dev(9) directly can result in deadlock.
*/
destroy_dev_sched(softc->dev);
cam_periph_lock(periph);
free(softc, M_DEVBUF);
}