summaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-05-10 17:41:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-20 20:31:35 -0400
commit36085049bc0acb6f2e784f430c2cc66944a2ef07 (patch)
tree7d38054380d14d28f0637832a319a975228cf317 /net/atm
parenta3929484af75ee524419edbbc4e9ce012c3d67c9 (diff)
downloadlinux-36085049bc0acb6f2e784f430c2cc66944a2ef07.tar.bz2
atm: switch do_atm_iobuf() to direct use of atm_getnames()
... and sod the compat_alloc_user_space() with its complications Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/atm')
-rw-r--r--net/atm/ioctl.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/net/atm/ioctl.c b/net/atm/ioctl.c
index e239cebf48da..fdd0e3434523 100644
--- a/net/atm/ioctl.c
+++ b/net/atm/ioctl.c
@@ -251,32 +251,13 @@ static struct {
static int do_atm_iobuf(struct socket *sock, unsigned int cmd,
unsigned long arg)
{
- struct atm_iobuf __user *iobuf;
- struct compat_atm_iobuf __user *iobuf32;
+ struct compat_atm_iobuf __user *iobuf32 = compat_ptr(arg);
u32 data;
- void __user *datap;
- int len, err;
-
- iobuf = compat_alloc_user_space(sizeof(*iobuf));
- iobuf32 = compat_ptr(arg);
- if (get_user(len, &iobuf32->length) ||
- get_user(data, &iobuf32->buffer))
- return -EFAULT;
- datap = compat_ptr(data);
- if (put_user(len, &iobuf->length) ||
- put_user(datap, &iobuf->buffer))
+ if (get_user(data, &iobuf32->buffer))
return -EFAULT;
- err = do_vcc_ioctl(sock, cmd, (unsigned long) iobuf, 0);
-
- if (!err) {
- if (copy_in_user(&iobuf32->length, &iobuf->length,
- sizeof(int)))
- err = -EFAULT;
- }
-
- return err;
+ return atm_getnames(&iobuf32->length, compat_ptr(data));
}
static int do_atmif_sioc(struct socket *sock, unsigned int cmd,