diff options
Diffstat (limited to 'fs/compat.c')
-rw-r--r-- | fs/compat.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/compat.c b/fs/compat.c index 2a88477330fc..ef5a0771592d 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1476,10 +1476,9 @@ int compat_do_execve(char * filename, | |||
1476 | int i; | 1476 | int i; |
1477 | 1477 | ||
1478 | retval = -ENOMEM; | 1478 | retval = -ENOMEM; |
1479 | bprm = kmalloc(sizeof(*bprm), GFP_KERNEL); | 1479 | bprm = kzalloc(sizeof(*bprm), GFP_KERNEL); |
1480 | if (!bprm) | 1480 | if (!bprm) |
1481 | goto out_ret; | 1481 | goto out_ret; |
1482 | memset(bprm, 0, sizeof(*bprm)); | ||
1483 | 1482 | ||
1484 | file = open_exec(filename); | 1483 | file = open_exec(filename); |
1485 | retval = PTR_ERR(file); | 1484 | retval = PTR_ERR(file); |
@@ -2170,9 +2169,12 @@ asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user * | |||
2170 | 2169 | ||
2171 | default: | 2170 | default: |
2172 | err = -EINVAL; | 2171 | err = -EINVAL; |
2173 | goto done; | 2172 | break; |
2174 | } | 2173 | } |
2175 | 2174 | ||
2175 | if (err) | ||
2176 | goto done; | ||
2177 | |||
2176 | oldfs = get_fs(); | 2178 | oldfs = get_fs(); |
2177 | set_fs(KERNEL_DS); | 2179 | set_fs(KERNEL_DS); |
2178 | /* The __user pointer casts are valid because of the set_fs() */ | 2180 | /* The __user pointer casts are valid because of the set_fs() */ |