<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/usb/misc/usbtest.c, branch v3.10</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>USB: altsetting overrides for usbtest</title>
<updated>2013-01-31T09:09:19+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2013-01-30T21:38:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=d0b4652f80c3276a57ede3b6b6d8159fa26c091f'/>
<id>d0b4652f80c3276a57ede3b6b6d8159fa26c091f</id>
<content type='text'>
The usbtest driver includes some rather simple-minded logic for
selecting an altsetting to test.  It doesn't work well for the g_zero
gadget, because it selects altsetting 0 (which doesn't have
isochronous endpoints) rather than altsetting 1 (which does have them,
if the gadget's hardware supports them).  This prevents usbtest's
isochronous tests (15, 16, 22, and 23) from working with g_zero.

Since g_zero is one of the most common gadget drivers used for USB
testing, usbtest should do a better job of supporting it.  But since
some programs may rely on the current scheme for selecting
altsettings, I didn't want to change it.

Instead, this patch (as1655) adds a module parameter to usbtest, which
can be used to override the default altsetting.  Since usbtest is
never used by normal users (most distributions probably don't even
build it), the new module parameter won't inconvenience anybody.  In
any case, it is entirely optional -- leaving it unset preserves the
existing behavior.

The patch also fixes a related bug in usbtest: After selecting an
altsetting, the driver neglects to store its selection.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The usbtest driver includes some rather simple-minded logic for
selecting an altsetting to test.  It doesn't work well for the g_zero
gadget, because it selects altsetting 0 (which doesn't have
isochronous endpoints) rather than altsetting 1 (which does have them,
if the gadget's hardware supports them).  This prevents usbtest's
isochronous tests (15, 16, 22, and 23) from working with g_zero.

Since g_zero is one of the most common gadget drivers used for USB
testing, usbtest should do a better job of supporting it.  But since
some programs may rely on the current scheme for selecting
altsettings, I didn't want to change it.

Instead, this patch (as1655) adds a module parameter to usbtest, which
can be used to override the default altsetting.  Since usbtest is
never used by normal users (most distributions probably don't even
build it), the new module parameter won't inconvenience anybody.  In
any case, it is entirely optional -- leaving it unset preserves the
existing behavior.

The patch also fixes a related bug in usbtest: After selecting an
altsetting, the driver neglects to store its selection.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtest: fix test number in log message</title>
<updated>2013-01-07T18:34:20+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2013-01-02T18:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2cb5000057fbd2237c19b8b8bd4f6948fd11f5f8'/>
<id>2cb5000057fbd2237c19b8b8bd4f6948fd11f5f8</id>
<content type='text'>
This patch (as1639) fixes a minor bug in the usbtest driver.  Due to
concurrent changes, a test originally written as number 17 got changed
to number 24, but the corresponding change was not made in the log
message.  This updates the log message.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch (as1639) fixes a minor bug in the usbtest driver.  Due to
concurrent changes, a test originally written as number 17 got changed
to number 24, but the corresponding change was not made in the log
message.  This updates the log message.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: usbtest: prevent a divide by zero bug</title>
<updated>2012-11-21T21:32:26+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2012-11-17T15:06:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=564e69893c63cefe4bcbdeda4f940bf68b6b4491'/>
<id>564e69893c63cefe4bcbdeda4f940bf68b6b4491</id>
<content type='text'>
If param-&gt;length is zero, then this could lead to a divide by zero bug
later in the function when we do: size %= max;

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If param-&gt;length is zero, then this could lead to a divide by zero bug
later in the function when we do: size %= max;

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: misc: usbtest: send ISO packets for g_zero</title>
<updated>2012-11-14T20:15:49+00:00</updated>
<author>
<name>Boyan Nedeltchev</name>
<email>boyan@ti.com</email>
</author>
<published>2012-11-12T11:06:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4b85c62411f7a95db33025b3aba29f7525c214d5'/>
<id>4b85c62411f7a95db33025b3aba29f7525c214d5</id>
<content type='text'>
since commit b4036cc (usb: gadget: add
isochronous support to gadget zero), g_zero
has learned about isochronous transfers, which
allows us to use usbtest.ko to exercise
isochronous pipes.

All we need to do to enable that functionality
on usbtest.ko, is set the "iso" to 1 on
struct usbtest_info

Signed-off-by: Boyan Nedeltchev &lt;boyan@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
since commit b4036cc (usb: gadget: add
isochronous support to gadget zero), g_zero
has learned about isochronous transfers, which
allows us to use usbtest.ko to exercise
isochronous pipes.

All we need to do to enable that functionality
on usbtest.ko, is set the "iso" to 1 on
struct usbtest_info

Signed-off-by: Boyan Nedeltchev &lt;boyan@ti.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtest: two super speed fixes for usbtest</title>
<updated>2012-05-01T17:38:27+00:00</updated>
<author>
<name>Paul Zimmerman</name>
<email>Paul.Zimmerman@synopsys.com</email>
</author>
<published>2012-04-16T21:19:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6a23ccd216b6a8ba2c67a9f9d8969b4431ad2920'/>
<id>6a23ccd216b6a8ba2c67a9f9d8969b4431ad2920</id>
<content type='text'>
bMaxPacketSize0 field for super speed is a power of 2, not a count.
The size itself is always 512.

Max packet size for a super speed bulk endpoint is 1024, so
allocate the urb size in halt_simple() accordingly.

Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
bMaxPacketSize0 field for super speed is a power of 2, not a count.
The size itself is always 512.

Max packet size for a super speed bulk endpoint is 1024, so
allocate the urb size in halt_simple() accordingly.

Signed-off-by: Paul Zimmerman &lt;paulz@synopsys.com&gt;
Acked-by: Felipe Balbi &lt;balbi@ti.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers/usb/misc/usbtest.c: add kfrees</title>
<updated>2012-04-18T21:13:52+00:00</updated>
<author>
<name>Julia Lawall</name>
<email>Julia.Lawall@lip6.fr</email>
</author>
<published>2012-03-25T19:08:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=f4a728d09a96d6a83d9c3f39035b1aa7726892ea'/>
<id>f4a728d09a96d6a83d9c3f39035b1aa7726892ea</id>
<content type='text'>
Free the two previously allocated buffers before exiting the function in an
error case.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Free the two previously allocated buffers before exiting the function in an
error case.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtest: avoid integer overflow in alloc_sglist()</title>
<updated>2012-04-17T22:54:57+00:00</updated>
<author>
<name>Xi Wang</name>
<email>xi.wang@gmail.com</email>
</author>
<published>2012-04-09T19:48:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8bde9a62ee74afa89f593c563e926d163b1f6ada'/>
<id>8bde9a62ee74afa89f593c563e926d163b1f6ada</id>
<content type='text'>
A large `nents' from userspace could overflow the allocation size,
leading to memory corruption.

| alloc_sglist()
| usbtest_ioctl()

Use kmalloc_array() to avoid the overflow.

Signed-off-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A large `nents' from userspace could overflow the allocation size,
leading to memory corruption.

| alloc_sglist()
| usbtest_ioctl()

Use kmalloc_array() to avoid the overflow.

Signed-off-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: usbtest: avoid integer overflow in test_ctrl_queue()</title>
<updated>2012-04-17T22:54:57+00:00</updated>
<author>
<name>Xi Wang</name>
<email>xi.wang@gmail.com</email>
</author>
<published>2012-04-09T19:48:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e65cdfae71cecec0fcd43a3f9ac8b5e4ae52db08'/>
<id>e65cdfae71cecec0fcd43a3f9ac8b5e4ae52db08</id>
<content type='text'>
Avoid overflowing context.count = param-&gt;sglen * param-&gt;iterations,
where both `sglen' and `iterations' are from userspace.

| test_ctrl_queue()
| usbtest_ioctl()

Keep -EOPNOTSUPP for error code.

Signed-off-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid overflowing context.count = param-&gt;sglen * param-&gt;iterations,
where both `sglen' and `iterations' are from userspace.

| test_ctrl_queue()
| usbtest_ioctl()

Keep -EOPNOTSUPP for error code.

Signed-off-by: Xi Wang &lt;xi.wang@gmail.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>USB: remove BKL comments</title>
<updated>2011-11-27T03:58:46+00:00</updated>
<author>
<name>Davidlohr Bueso</name>
<email>dave@gnu.org</email>
</author>
<published>2011-11-24T15:23:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=568987116ed5fce7e9e9c731ffe5f5af193ab2e3'/>
<id>568987116ed5fce7e9e9c731ffe5f5af193ab2e3</id>
<content type='text'>
The BKL is a gonner.

Signed-off-by: Davidlohr Bueso &lt;dave@gnu.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The BKL is a gonner.

Signed-off-by: Davidlohr Bueso &lt;dave@gnu.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: Provide usb_speed_string() function</title>
<updated>2011-09-18T08:29:04+00:00</updated>
<author>
<name>Michal Nazarewicz</name>
<email>mina86@mina86.com</email>
</author>
<published>2011-08-30T15:11:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e538dfdae85244fd2c4231725d82cc1f1bc4942c'/>
<id>e538dfdae85244fd2c4231725d82cc1f1bc4942c</id>
<content type='text'>
In a few places in the kernel, the code prints
a human-readable USB device speed (eg. "high speed").
This involves a switch statement sometimes wrapped
around in ({ ... }) block leading to code repetition.

To mitigate this issue, this commit introduces
usb_speed_string() function, which returns
a human-readable name of provided speed.

It also changes a few places switch was used to use
this new function.  This changes a bit the way the
speed is printed in few instances at the same time
standardising it.

Signed-off-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In a few places in the kernel, the code prints
a human-readable USB device speed (eg. "high speed").
This involves a switch statement sometimes wrapped
around in ({ ... }) block leading to code repetition.

To mitigate this issue, this commit introduces
usb_speed_string() function, which returns
a human-readable name of provided speed.

It also changes a few places switch was used to use
this new function.  This changes a bit the way the
speed is printed in few instances at the same time
standardising it.

Signed-off-by: Michal Nazarewicz &lt;mina86@mina86.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
