diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-04-08 09:08:04 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-04-21 05:02:51 +0200 |
commit | 0e639bdeef26faf287db77a15530f3f295a4ae04 (patch) | |
tree | b5f15e44cd974561a426fc2e07c792255b1328cb /fs/xfs/linux-2.6/xfs_ioctl32.c | |
parent | sysfs: use memdup_user() (diff) | |
download | linux-0e639bdeef26faf287db77a15530f3f295a4ae04.tar.xz linux-0e639bdeef26faf287db77a15530f3f295a4ae04.zip |
xfs: use memdup_user()
Remove open-coded memdup_user()
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_ioctl32.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_ioctl32.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_ioctl32.c b/fs/xfs/linux-2.6/xfs_ioctl32.c index c70c4e3db790..0882d166239a 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl32.c +++ b/fs/xfs/linux-2.6/xfs_ioctl32.c @@ -427,20 +427,16 @@ xfs_compat_attrmulti_by_handle( if (!size || size > 16 * PAGE_SIZE) goto out_dput; - error = ENOMEM; - ops = kmalloc(size, GFP_KERNEL); - if (!ops) + ops = memdup_user(compat_ptr(am_hreq.ops), size); + if (IS_ERR(ops)) { + error = PTR_ERR(ops); goto out_dput; - - error = EFAULT; - if (copy_from_user(ops, compat_ptr(am_hreq.ops), size)) - goto out_kfree_ops; + } attr_name = kmalloc(MAXNAMELEN, GFP_KERNEL); if (!attr_name) goto out_kfree_ops; - error = 0; for (i = 0; i < am_hreq.opcount; i++) { ops[i].am_error = strncpy_from_user(attr_name, |