diff --git a/[refs] b/[refs] index 90f5d6cf53f3..ace268ad379e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 61be228a06dc6e8662f30e89eda3c12083c1f379 +refs/heads/master: 964ee7df90d799e38fb1556c57cd5c45fc736436 diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 8efbdc606a1e..6dc92c39dd94 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -1395,18 +1395,14 @@ int do_execve(char * filename, return retval; } -int set_binfmt(struct linux_binfmt *new) +void set_binfmt(struct linux_binfmt *new) { - struct linux_binfmt *old = current->binfmt; + if (current->binfmt) + module_put(current->binfmt->module); - if (new) { - if (!try_module_get(new->module)) - return -1; - } current->binfmt = new; - if (old) - module_put(old->module); - return 0; + if (new) + __module_get(new->module); } EXPORT_SYMBOL(set_binfmt); diff --git a/trunk/include/linux/binfmts.h b/trunk/include/linux/binfmts.h index 2046b5b8af48..aece486ac734 100644 --- a/trunk/include/linux/binfmts.h +++ b/trunk/include/linux/binfmts.h @@ -120,7 +120,7 @@ extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); extern int prepare_bprm_creds(struct linux_binprm *bprm); extern void install_exec_creds(struct linux_binprm *bprm); extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); -extern int set_binfmt(struct linux_binfmt *new); +extern void set_binfmt(struct linux_binfmt *new); extern void free_bprm(struct linux_binprm *); #endif /* __KERNEL__ */