ChangeSet 1.2239, 2005/04/04 08:06:39-07:00, [EMAIL PROTECTED]
[PATCH] usblcd portability fix
usblcd.c passes address of size_t variable to function that expects int
*. That breaks on 64bit big-endian, obviously. Fixed, along with the
usb-skeleton.c - that's where the bug had been copied from.
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
Signed-off-by: Al Viro <[EMAIL PROTECTED]>
misc/usblcd.c | 7 ++++---
usb-skeleton.c | 7 ++++---
2 files changed, 8 insertions(+), 6 deletions(-)
diff -Nru a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
--- a/drivers/usb/misc/usblcd.c 2005-04-04 09:09:05 -07:00
+++ b/drivers/usb/misc/usblcd.c 2005-04-04 09:09:05 -07:00
@@ -109,6 +109,7 @@
{
struct usb_lcd *dev;
int retval = 0;
+ int bytes_read;
dev = (struct usb_lcd *)file->private_data;
@@ -117,14 +118,14 @@
usb_rcvbulkpipe(dev->udev,
dev->bulk_in_endpointAddr),
dev->bulk_in_buffer,
min(dev->bulk_in_size, count),
- &count, 10000);
+ &bytes_read, 10000);
/* if the read was successful, copy the data to userspace */
if (!retval) {
- if (copy_to_user(buffer, dev->bulk_in_buffer, count))
+ if (copy_to_user(buffer, dev->bulk_in_buffer, bytes_read))
retval = -EFAULT;
else
- retval = count;
+ retval = bytes_read;
}
return retval;
diff -Nru a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
--- a/drivers/usb/usb-skeleton.c 2005-04-04 09:09:05 -07:00
+++ b/drivers/usb/usb-skeleton.c 2005-04-04 09:09:05 -07:00
@@ -112,6 +112,7 @@
{
struct usb_skel *dev;
int retval = 0;
+ int bytes_read;
dev = (struct usb_skel *)file->private_data;
@@ -120,14 +121,14 @@
usb_rcvbulkpipe(dev->udev,
dev->bulk_in_endpointAddr),
dev->bulk_in_buffer,
min(dev->bulk_in_size, count),
- &count, 10000);
+ &bytes_read, 10000);
/* if the read was successful, copy the data to userspace */
if (!retval) {
- if (copy_to_user(buffer, dev->bulk_in_buffer, count))
+ if (copy_to_user(buffer, dev->bulk_in_buffer, bytes_read))
retval = -EFAULT;
else
- retval = count;
+ retval = bytes_read;
}
return retval;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html