summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 8efbdc606a1e..6dc92c39dd94 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1395,18 +1395,14 @@ out_ret:
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);