]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/compat.c
[PATCH] use kzalloc and kcalloc in core fs code
[mirror_ubuntu-zesty-kernel.git] / fs / compat.c
index 5333c7d7427f6feeee2d72678893cde41294a3f4..ef5a0771592d1a5d30d2cb9eb53799ed2c862520 100644 (file)
@@ -114,6 +114,7 @@ asmlinkage long compat_sys_newlstat(char __user * filename,
        return error;
 }
 
+#ifndef __ARCH_WANT_STAT64
 asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename,
                struct compat_stat __user *statbuf, int flag)
 {
@@ -134,6 +135,7 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user *filename,
 out:
        return error;
 }
+#endif
 
 asmlinkage long compat_sys_newfstat(unsigned int fd,
                struct compat_stat __user * statbuf)
@@ -1474,10 +1476,9 @@ int compat_do_execve(char * filename,
        int i;
 
        retval = -ENOMEM;
-       bprm = kmalloc(sizeof(*bprm), GFP_KERNEL);
+       bprm = kzalloc(sizeof(*bprm), GFP_KERNEL);
        if (!bprm)
                goto out_ret;
-       memset(bprm, 0, sizeof(*bprm));
 
        file = open_exec(filename);
        retval = PTR_ERR(file);
@@ -2168,9 +2169,12 @@ asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *
 
        default:
                err = -EINVAL;
-               goto done;
+               break;
        }
 
+       if (err)
+               goto done;
+
        oldfs = get_fs();
        set_fs(KERNEL_DS);
        /* The __user pointer casts are valid because of the set_fs() */