aboutsummaryrefslogtreecommitdiffstats
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:
1395 return retval; 1395 return retval;
1396} 1396}
1397 1397
1398int set_binfmt(struct linux_binfmt *new) 1398void set_binfmt(struct linux_binfmt *new)
1399{ 1399{
1400 struct linux_binfmt *old = current->binfmt; 1400 if (current->binfmt)
1401 module_put(current->binfmt->module);
1401 1402
1402 if (new) {
1403 if (!try_module_get(new->module))
1404 return -1;
1405 }
1406 current->binfmt = new; 1403 current->binfmt = new;
1407 if (old) 1404 if (new)
1408 module_put(old->module); 1405 __module_get(new->module);
1409 return 0;
1410} 1406}
1411 1407
1412EXPORT_SYMBOL(set_binfmt); 1408EXPORT_SYMBOL(set_binfmt);