NFSv4.1: Fix nfs4_callback_recallslot to work with dynamic slot allocation
[firefly-linux-kernel-4.4.55.git] / fs / coredump.c
index fd37facac8dc55f40281008ceb6799c667105588..ce47379bfa61cfecb7bc747d3fbc7031a65f3080 100644 (file)
@@ -450,11 +450,12 @@ static int umh_pipe_setup(struct subprocess_info *info, struct cred *new)
 
        cp->file = files[1];
 
-       replace_fd(0, files[0], 0);
+       err = replace_fd(0, files[0], 0);
+       fput(files[0]);
        /* and disallow core files too */
        current->signal->rlim[RLIMIT_CORE] = (struct rlimit){1, 1};
 
-       return 0;
+       return err;
 }
 
 void do_coredump(siginfo_t *siginfo, struct pt_regs *regs)