Skip to content

Commit

Permalink
atm: switch do_atmif_sioc() to direct use of atm_dev_ioctl()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed May 21, 2020
1 parent 8cacb41 commit 0edecc0
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions net/atm/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,30 +286,13 @@ static int do_atm_iobuf(struct socket *sock, unsigned int cmd,
static int do_atmif_sioc(struct socket *sock, unsigned int cmd,
unsigned long arg)
{
struct atmif_sioc __user *sioc;
struct compat_atmif_sioc __user *sioc32;
struct compat_atmif_sioc __user *sioc32 = compat_ptr(arg);
int number;
u32 data;
void __user *datap;
int err;

sioc = compat_alloc_user_space(sizeof(*sioc));
sioc32 = compat_ptr(arg);

if (copy_in_user(&sioc->number, &sioc32->number, 2 * sizeof(int)) ||
get_user(data, &sioc32->arg))
return -EFAULT;
datap = compat_ptr(data);
if (put_user(datap, &sioc->arg))
if (get_user(data, &sioc32->arg) || get_user(number, &sioc32->number))
return -EFAULT;

err = do_vcc_ioctl(sock, cmd, (unsigned long) sioc, 0);

if (!err) {
if (copy_in_user(&sioc32->length, &sioc->length,
sizeof(int)))
err = -EFAULT;
}
return err;
return atm_dev_ioctl(cmd, compat_ptr(data), &sioc32->length, number, 0);
}

static int do_atm_ioctl(struct socket *sock, unsigned int cmd32,
Expand Down

0 comments on commit 0edecc0

Please sign in to comment.