]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/binfmt_misc.c
binfmt_misc: fix false -ENOEXEC when coupled with other binary handlers
[mv-sheeva.git] / fs / binfmt_misc.c
index 756205314c24401fc31ebbb6eb7c479aa4c92145..8d7e88e02e0f9cc13207d86ee090a2594f79497b 100644 (file)
@@ -120,8 +120,6 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        if (bprm->misc_bang)
                goto _ret;
 
-       bprm->misc_bang = 1;
-
        /* to keep locking time low, we copy the interpreter string */
        read_lock(&entries_lock);
        fmt = check_file(bprm);
@@ -199,6 +197,8 @@ static int load_misc_binary(struct linux_binprm *bprm, struct pt_regs *regs)
        if (retval < 0)
                goto _error;
 
+       bprm->misc_bang = 1;
+
        retval = search_binary_handler (bprm, regs);
        if (retval < 0)
                goto _error;