summaryrefslogtreecommitdiffstats
path: root/sys/fs/devfs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2006-09-19 14:03:02 +0000
committerkib <kib@FreeBSD.org>2006-09-19 14:03:02 +0000
commit11200e2de3b5360427a73ee6ff445ce62a785119 (patch)
tree6a86b9bd8dc17142dec7287db265dd86edd8f0c8 /sys/fs/devfs
parent16caef0189c032e9168432823db1b9cae389f588 (diff)
downloadFreeBSD-src-11200e2de3b5360427a73ee6ff445ce62a785119.zip
FreeBSD-src-11200e2de3b5360427a73ee6ff445ce62a785119.tar.gz
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)
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r--sys/fs/devfs/devfs_vnops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 79f6c60..b711573 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);
}
OpenPOWER on IntegriCloud