[PATCH v3] usbdevfs: Fix broken scatter-gather transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The handling of large output bulk transfers is broken; the same user
page is read over and over again. Fixed with this patch.

Cc: stable@xxxxxxxxxx
Acked-by: Peter Stuge <peter@xxxxxxxx>
Acked-by: Hans de Goede <hdegoede@xxxxxxxxxx>
Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Henrik Rydberg <rydberg@xxxxxxxxxxx>
---
Hi Greg,

Here is the formal and third version of the patch. Version two still
made me nervous, so I moved the increment to where it is clear that
the buffer pointer is never referenced again later in the function. I
still kept the ACKS, hope that is alright with everyone.

Thanks,
Henrik

 drivers/usb/core/devio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index ebb8a9d..7f75343 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -1348,6 +1348,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
 					ret = -EFAULT;
 					goto error;
 				}
+				uurb->buffer += u;
 			}
 			totlen -= u;
 		}
-- 
1.7.12.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux