usb: misc: usbtest: fix pattern tests for scatterlists.
authorMathias Nyman <mathias.nyman@linux.intel.com>
Mon, 2 May 2016 08:39:03 +0000 (11:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Jun 2016 19:15:51 +0000 (12:15 -0700)
commite3a037a5b851f808883b7bc6c192195635dcb758
tree2f83215c91033aa2b70039c30e6ae57cb223e170
parent51c312792d3bb676bb1d4faa5cd0dd56d7ea2e60
usb: misc: usbtest: fix pattern tests for scatterlists.

commit cdc77c82a8286b1181b81b6e5ef60c8e83ded7bc upstream.

The current implemenentation restart the sent pattern for each entry in
the sg list. The receiving end expects a continuous pattern, and test
will fail unless scatterilst entries happen to be aligned with the
pattern

Fix this by calculating the pattern byte based on total sent size
instead of just the current sg entry.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Fixes: 8b5249019352 ("[PATCH] USB: usbtest: scatterlist OUT data pattern testing")
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usbtest.c