rename: fix leak I hope
authorAlan Cox <alan@linux.intel.com>
Mon, 5 Mar 2018 19:29:47 +0000 (19:29 +0000)
committerAlan Cox <alan@linux.intel.com>
Mon, 5 Mar 2018 19:29:47 +0000 (19:29 +0000)
Rename needs some more thinking about

Kernel/syscall_other.c

index fc5597d..95410ad 100644 (file)
@@ -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);