Fix the bug in rev. 1.134. In devfs_allocv_drop_refs(), when not_found == 2

and drop_dm_lock is true, no unlocking shall be attempted. The lock is
already dropped and memory is freed.

Found with:	Coverity Prevent(tm)
CID:	1536
Approved by:	pjd (mentor)
This commit is contained in:
kib 2006-09-19 14:03:02 +00:00
parent 16caef0189
commit 11200e2de3

@ -145,7 +145,7 @@ devfs_allocv_drop_refs(int drop_dm_lock, struct devfs_mount *dmp,
sx_xunlock(&dmp->dm_lock);
devfs_unmount_final(dmp);
}
if (not_found == 1 || drop_dm_lock)
if (not_found == 1 || (drop_dm_lock && not_found != 2))
sx_unlock(&dmp->dm_lock);
return (not_found);
}