From 3ca1ed8a130e8f86c9f879eeaf7c46533a233dee Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 5 Mar 2018 19:29:47 +0000 Subject: [PATCH] rename: fix leak I hope Rename needs some more thinking about --- Kernel/syscall_other.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel/syscall_other.c b/Kernel/syscall_other.c index fc5597d9..95410ad9 100644 --- a/Kernel/syscall_other.c +++ b/Kernel/syscall_other.c @@ -94,9 +94,9 @@ arg_t _rename(void) goto nogood; } /* Drop the reference to the unlinked file */ - i_unlock_deref(dstp); - } - i_lock(dstp); + i_deref(dsti); + } else + i_lock(dstp); /* Ok we may proceed: we set up fname earlier */ if (!ch_link(dstp, "", lastname, srci)) { i_unlock(dstp); -- 2.34.1