Don't exclude XPT SIM from locking in xpt_create_path_unlocked().

We don't want xpt periph, device, target or bus disappeared because of
incorrect reference counting.
This commit is contained in:
Alexander Motin 2012-10-13 18:24:52 +00:00
parent 8cdef07f7c
commit 9bccc7a939
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241510

View File

@ -3441,19 +3441,14 @@ xpt_create_path_unlocked(struct cam_path **new_path_ptr,
struct cam_path *path;
struct cam_eb *bus = NULL;
cam_status status;
int need_unlock = 0;
path = (struct cam_path *)malloc(sizeof(*path), M_CAMPATH, M_WAITOK);
if (path_id != CAM_BUS_WILDCARD) {
bus = xpt_find_bus(path_id);
if (bus != NULL) {
need_unlock = 1;
CAM_SIM_LOCK(bus->sim);
}
}
bus = xpt_find_bus(path_id);
if (bus != NULL)
CAM_SIM_LOCK(bus->sim);
status = xpt_compile_path(path, periph, path_id, target_id, lun_id);
if (need_unlock) {
if (bus != NULL) {
CAM_SIM_UNLOCK(bus->sim);
xpt_release_bus(bus);
}