<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/class, branch v2.6.32</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.32</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.32'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-11-18T00:46:33Z</updated>
<entry>
<title>USB: cdc_acm: Fix memory leak after hangup</title>
<updated>2009-11-18T00:46:33Z</updated>
<author>
<name>Francesco Lavra</name>
<email>francescolavra@interfree.it</email>
</author>
<published>2009-11-03T10:53:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=051522bb47797f7168a617a0752d7ddc1a2f6f24'/>
<id>urn:sha1:051522bb47797f7168a617a0752d7ddc1a2f6f24</id>
<content type='text'>
Am Donnerstag, 10. September 2009 15:43:53 schrieb Dietmar Hilbrich:
&gt; Hello,
&gt;
&gt; i have the following problem with the cdc-acm - driver:
&gt;
&gt; I'm using the driver with an "Ericsson F3507G" on a Thinkpad T400.
&gt;
&gt; If a disable the device (with the RFKill-Switch) while it is used by a
&gt; programm like ppp, the driver doesn't seem to correctly clean up the tty,
&gt; even after the program has been closed)
&gt;
&gt; The tty is still active (e.g. there still exists an entry in
&gt; /sys/dev/char/166:0 if ttyACM0 was used) and if a reacticate the device,
&gt; this device entry will be skipped and the Device-Nodes ttyACM1, ttyACM2
&gt; and ttyACM3 will be used.
&gt;
&gt; This problem was introduced with the commit
&gt; 10077d4a6674f535abdbe25cdecb1202af7948f1 (before 2.6.31-rc1) and still
&gt; exists in 2.6.31.
&gt;
&gt; I was able the fix this problem with the following patch:
&gt;
&gt; diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
&gt; index 2bfc41e..0970d2f 100644
&gt; --- a/drivers/usb/class/cdc-acm.c
&gt; +++ b/drivers/usb/class/cdc-acm.c
&gt; @@ -676,6 +676,7 @@ static void acm_tty_hangup(struct tty_struct *tty)
&gt;         struct acm *acm = tty-&gt;driver_data;
&gt;         tty_port_hangup(&amp;acm-&gt;port);
&gt;         acm_port_down(acm, 0);
&gt; +       acm_tty_unregister(acm);
&gt;  }

I have the same problem with cdc-acm (I'm using a Samsung SGH-U900): when I
unplug it from the USB port during a PPP connection, the ppp daemon gets the
hangup correctly (and closes the device), but the struct acm corresponding to
the device disconnected is not freed. Hence reconnecting the device results in
creation of /dev/ttyACM(x+1). The same happens when the system is hibernated
during a PPP connection.

This memory leak is due to the fact that when the tty is hung up,
tty_port_close_start() returns always zero, and acm_tty_close() never reaches
the point where acm_tty_unregister() is called.

Here is a fix for this.

Signed-off-by: Francesco Lavra &lt;francescolavra@interfree.it&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: cdc_acm: Fix race condition when opening tty</title>
<updated>2009-11-18T00:46:33Z</updated>
<author>
<name>Henry Gebhardt</name>
<email>gebhardt@astro.uni-tuebingen.de</email>
</author>
<published>2009-11-04T10:19:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=18a77b5d237a67d2c621a46f5271a3b51da1b380'/>
<id>urn:sha1:18a77b5d237a67d2c621a46f5271a3b51da1b380</id>
<content type='text'>
If acm_rx_tasklet() gets called before tty_port_block_til_ready()
returns, then bulk IN urbs may not be sent. This fixes it.

Signed-off-by: Henry Gebhardt &lt;gebhardt@astro.uni-tuebingen.de&gt;
Acked-by: Oliver Neukum &lt;oliver@neukum.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbtmc: fix timeout increase</title>
<updated>2009-10-09T20:52:06Z</updated>
<author>
<name>Gergely Imreh</name>
<email>imrehg@gmail.com</email>
</author>
<published>2009-09-15T08:03:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=35f76e897d67fb62b4ec0be01fc0caaeb7f90108'/>
<id>urn:sha1:35f76e897d67fb62b4ec0be01fc0caaeb7f90108</id>
<content type='text'>
The current 10ms timeout is too short for some normal USBTMC device
operation, increase it to a value which was tested with previously
affected Tektronix oscilloscopes.

Signed-off-by: Gergely Imreh &lt;imrehg@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>const: constify remaining file_operations</title>
<updated>2009-10-01T23:11:11Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-10-01T22:43:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=828c09509b9695271bcbdc53e9fc9a6a737148d2'/>
<id>urn:sha1:828c09509b9695271bcbdc53e9fc9a6a737148d2</id>
<content type='text'>
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: Mike Frysinger &lt;vapier@gentoo.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>USB: fix USBTMC get_capabilities success handling</title>
<updated>2009-09-23T13:46:39Z</updated>
<author>
<name>Gergely Imreh</name>
<email>imrehg@gmail.com</email>
</author>
<published>2009-09-07T02:47:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0a38365d9585bf3fb71f7c57fd532441a14f3e8'/>
<id>urn:sha1:d0a38365d9585bf3fb71f7c57fd532441a14f3e8</id>
<content type='text'>
In order:
Add reference to relevant section of USBTMC usb488 subclass specs.
Print debug output of capabilities only when it was retrieved successfully.
Clear return value on success, otherwise driver always reports failure.

Signed-off-by: Gergely Imreh &lt;imrehg@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbtmc: correct termination condition for reads.</title>
<updated>2009-09-23T13:46:35Z</updated>
<author>
<name>Steve Holland</name>
<email>sdh4@iastate.edu</email>
</author>
<published>2009-06-18T22:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4143d178e7b39c00d5277040c69a1522c4d98871'/>
<id>urn:sha1:4143d178e7b39c00d5277040c69a1522c4d98871</id>
<content type='text'>
Follow T&amp;M convention of obeying EOM flag.  Avoid exception cases where
instrument response size matches a buffer size.

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbtmc: inhibit corruption</title>
<updated>2009-09-23T13:46:35Z</updated>
<author>
<name>Steve Holland</name>
<email>sdh4@iastate.edu</email>
</author>
<published>2009-06-18T22:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=92d07e422df3cc5370d0d9b95a671abb69d50ef1'/>
<id>urn:sha1:92d07e422df3cc5370d0d9b95a671abb69d50ef1</id>
<content type='text'>
Limit data copied to userspace to amount requested.  Prevents a faulty
instrument from overwriting user memory.

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbtmc: Fix short reads in usbtmc_read()</title>
<updated>2009-09-23T13:46:35Z</updated>
<author>
<name>Steve Holland</name>
<email>sdh4@iastate.edu</email>
</author>
<published>2009-06-18T22:37:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c2cd26e15b84b964c489f2aff278cdaf03840c93'/>
<id>urn:sha1:c2cd26e15b84b964c489f2aff278cdaf03840c93</id>
<content type='text'>
The header size should not be included in the number of bytes requested of the
instrument

Signed-off-by: Steve Holland &lt;sdh4@iastate.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbtmc: fix printk format warnings</title>
<updated>2009-09-23T13:46:30Z</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2009-07-28T18:22:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a2fbf10eba3a38407e3984bc9503342de2b5e399'/>
<id>urn:sha1:a2fbf10eba3a38407e3984bc9503342de2b5e399</id>
<content type='text'>
Fix printk format warnings:
drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 4 has type 'u32'
drivers/usb/class/usbtmc.c:466: warning: format '%zu' expects type 'size_t', but argument 5 has type 'int'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>USB: usbtmc: sanity checks for DEV_DEP_MSG_IN urbs</title>
<updated>2009-09-23T13:46:30Z</updated>
<author>
<name>Guus Sliepen</name>
<email>guus@sliepen.org</email>
</author>
<published>2009-07-22T15:39:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=665d7662d15441b4b3e54131a9418a1a198d0d31'/>
<id>urn:sha1:665d7662d15441b4b3e54131a9418a1a198d0d31</id>
<content type='text'>
According to the specifications, an instrument should not return more data in a
DEV_DEP_MSG_IN urb than requested.  However, some instruments can send more
than requested. This could cause the kernel to write the extra data past the
end of the buffer provided by read().

Fix this by checking that the value of the TranserSize field is not larger than
the urb itself and not larger than the size of the userspace buffer. Also
correctly decrement the remaining size of the buffer when userspace read()s
more than USBTMC_SIZE_IOBUFFER.

Signed-off-by: Guus Sliepen &lt;guus@sliepen.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
