Commit 26a5cc5c authored by Frank Zago's avatar Frank Zago Committed by Greg Kroah-Hartman

[PATCH] [PATCH] (repost) fix for big endian machines in scanner.c

This patch fixes a problem with big endian machines and scanner drivers which
use the SCANNER_IOCTL_CTRLMSG ioctl. The big endian to little endian swap was
done twice, resulting in a no-op.
parent ccbb9605
......@@ -774,7 +774,7 @@ ioctl_scanner(struct inode *inode, struct file *file,
if (copy_from_user(&cmsg, (void *)arg, sizeof(cmsg)))
return -EFAULT;
nb = le16_to_cpup(&cmsg.req.wLength);
nb = cmsg.req.wLength;
if (nb > sizeof(buf))
return -EINVAL;
......@@ -789,8 +789,8 @@ ioctl_scanner(struct inode *inode, struct file *file,
ret = usb_control_msg(dev, pipe, cmsg.req.bRequest,
cmsg.req.bRequestType,
le16_to_cpup(&cmsg.req.wValue),
le16_to_cpup(&cmsg.req.wIndex),
cmsg.req.wValue,
cmsg.req.wIndex,
buf, nb, HZ);
if (ret < 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment