From 84a0be4a239bc3ed08a3cb5a74b1d768d705b8d7 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 16 Aug 2022 10:45:48 +0000 Subject: [PATCH] vfs: plug a dead store in kern_linkat_vp Reported by: clang --analyze --- sys/kern/vfs_syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index ba62fdb7e81e..c40d1092574e 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1643,7 +1643,7 @@ kern_linkat_vp(struct thread *td, struct vnode *vp, int fd, const char *path, vput(nd.ni_dvp); vrele(vp); return (EXDEV); - } else if ((error = vn_lock(vp, LK_EXCLUSIVE)) == 0) { + } else if (vn_lock(vp, LK_EXCLUSIVE) == 0) { error = can_hardlink(vp, td->td_ucred); #ifdef MAC if (error == 0)