Skip to content

Commit 3608504

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent a392948 commit 3608504

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

net/atm/ioctl.c

+3-22
Original file line numberDiff line numberDiff line change
@@ -251,32 +251,13 @@ static struct {
251251
static int do_atm_iobuf(struct socket *sock, unsigned int cmd,
252252
unsigned long arg)
253253
{
254-
struct atm_iobuf __user *iobuf;
255-
struct compat_atm_iobuf __user *iobuf32;
254+
struct compat_atm_iobuf __user *iobuf32 = compat_ptr(arg);
256255
u32 data;
257-
void __user *datap;
258-
int len, err;
259-
260-
iobuf = compat_alloc_user_space(sizeof(*iobuf));
261-
iobuf32 = compat_ptr(arg);
262256

263-
if (get_user(len, &iobuf32->length) ||
264-
get_user(data, &iobuf32->buffer))
265-
return -EFAULT;
266-
datap = compat_ptr(data);
267-
if (put_user(len, &iobuf->length) ||
268-
put_user(datap, &iobuf->buffer))
257+
if (get_user(data, &iobuf32->buffer))
269258
return -EFAULT;
270259

271-
err = do_vcc_ioctl(sock, cmd, (unsigned long) iobuf, 0);
272-
273-
if (!err) {
274-
if (copy_in_user(&iobuf32->length, &iobuf->length,
275-
sizeof(int)))
276-
err = -EFAULT;
277-
}
278-
279-
return err;
260+
return atm_getnames(&iobuf32->length, compat_ptr(data));
280261
}
281262

282263
static int do_atmif_sioc(struct socket *sock, unsigned int cmd,

0 commit comments

Comments
 (0)