Merge tag 'denywrite-for-5.15' of git://github.com/davidhildenbrand/linux
[linux-2.6-microblaze.git] / fs / exec.c
index 2dc489c..a098c13 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1272,7 +1272,9 @@ int begin_new_exec(struct linux_binprm * bprm)
         * not visibile until then. This also enables the update
         * to be lockless.
         */
-       set_mm_exe_file(bprm->mm, bprm->file);
+       retval = set_mm_exe_file(bprm->mm, bprm->file);
+       if (retval)
+               goto out;
 
        /* If the binary is not readable then enforce mm->dumpable=0 */
        would_dump(bprm, bprm->file);