diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-04-26 17:00:01 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-04-26 17:00:01 +1000 |
commit | 156bc9d0af408cf0c7cdc27cd02791d340adf6bd (patch) | |
tree | 4a1c94470cb82e7e8c88a3270d4595cbdaed9d68 /fs/xattr.c | |
parent | 3f6ac2b885a192bf688b535a4f9dc329bc7e97ff (diff) | |
parent | b7796f38de8afef781e52f484599845de84f9cf4 (diff) |
Merge branch 'akpm/master'
Diffstat (limited to 'fs/xattr.c')
-rw-r--r-- | fs/xattr.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/fs/xattr.c b/fs/xattr.c index 7e3317cf4045..464c94bf65f9 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -431,12 +431,9 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value, if (size) { if (size > XATTR_SIZE_MAX) return -E2BIG; - kvalue = kmalloc(size, GFP_KERNEL | __GFP_NOWARN); - if (!kvalue) { - kvalue = vmalloc(size); - if (!kvalue) - return -ENOMEM; - } + kvalue = kvmalloc(size, GFP_KERNEL); + if (!kvalue) + return -ENOMEM; if (copy_from_user(kvalue, value, size)) { error = -EFAULT; goto out; @@ -528,12 +525,9 @@ getxattr(struct dentry *d, const char __user *name, void __user *value, if (size) { if (size > XATTR_SIZE_MAX) size = XATTR_SIZE_MAX; - kvalue = kzalloc(size, GFP_KERNEL | __GFP_NOWARN); - if (!kvalue) { - kvalue = vmalloc(size); - if (!kvalue) - return -ENOMEM; - } + kvalue = kvzalloc(size, GFP_KERNEL); + if (!kvalue) + return -ENOMEM; } error = vfs_getxattr(d, kname, kvalue, size); @@ -611,12 +605,9 @@ listxattr(struct dentry *d, char __user *list, size_t size) if (size) { if (size > XATTR_LIST_MAX) size = XATTR_LIST_MAX; - klist = kmalloc(size, __GFP_NOWARN | GFP_KERNEL); - if (!klist) { - klist = vmalloc(size); - if (!klist) - return -ENOMEM; - } + klist = kvmalloc(size, GFP_KERNEL); + if (!klist) + return -ENOMEM; } error = vfs_listxattr(d, klist, size); |