]> 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 2a88477330fcbca9c71a8613981d205c7d8b9021..ef5a0771592d1a5d30d2cb9eb53799ed2c862520 100644 (file)
@@ -1476,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);
@@ -2170,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() */