usb: usbtest: avoid integer overflow in test_ctrl_queue()
authorXi Wang <xi.wang@gmail.com>
Mon, 9 Apr 2012 19:48:55 +0000 (15:48 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Apr 2012 22:54:57 +0000 (15:54 -0700)
commite65cdfae71cecec0fcd43a3f9ac8b5e4ae52db08
tree58a21396dcd320fd530fc1e49be4f87edb2582d0
parent8963c487a80b4688c9e68dcc504a90074aacc145
usb: usbtest: avoid integer overflow in test_ctrl_queue()

Avoid overflowing context.count = param->sglen * param->iterations,
where both `sglen' and `iterations' are from userspace.

| test_ctrl_queue()
| usbtest_ioctl()

Keep -EOPNOTSUPP for error code.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usbtest.c