firewire: switch ioctl_queue_iso to use of copy_from_user()

no point trying to do access_ok() for all those __copy_from_user()
at once.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro 2020-02-18 15:40:40 -05:00
parent 8f3d9f3542
commit daa98831dd

View File

@ -1081,8 +1081,6 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg)
return -EINVAL; return -EINVAL;
p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(a->packets); p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(a->packets);
if (!access_ok(p, a->size))
return -EFAULT;
end = (void __user *)p + a->size; end = (void __user *)p + a->size;
count = 0; count = 0;
@ -1120,7 +1118,7 @@ static int ioctl_queue_iso(struct client *client, union ioctl_arg *arg)
&p->header[transmit_header_bytes / 4]; &p->header[transmit_header_bytes / 4];
if (next > end) if (next > end)
return -EINVAL; return -EINVAL;
if (__copy_from_user if (copy_from_user
(u.packet.header, p->header, transmit_header_bytes)) (u.packet.header, p->header, transmit_header_bytes))
return -EFAULT; return -EFAULT;
if (u.packet.skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT && if (u.packet.skip && ctx->type == FW_ISO_CONTEXT_TRANSMIT &&