From 11200e2de3b5360427a73ee6ff445ce62a785119 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 19 Sep 2006 14:03:02 +0000 Subject: [PATCH] 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) --- sys/fs/devfs/devfs_vnops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 79f6c6015b57..b711573ba2d1 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -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); }