]> git.karo-electronics.de Git - karo-tx-linux.git/commit
USB: usbmon: fix read(2)
authorPete Zaitcev <zaitcev@redhat.com>
Fri, 14 Nov 2008 16:47:41 +0000 (09:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:09 +0000 (10:55 -0800)
commitaf4df26152cec2b2d9a1f04872eb9140202ccf13
treea2d4b12fb7a7e02ca3199d2ce53cfa522c01c4f7
parentd38a3218e8e8a74de61c1d5db462d499519aa7da
USB: usbmon: fix read(2)

commit f1c0a2a3aff53698f4855968d576464041d49b39 upstream.

There's a bug in the usbmon binary reader: When using read() to fetch
the packets and a packet's data is partially read, the next read call
will once again return up to len_cap bytes of data. The b_read counter
is not regarded when determining the remaining chunk size.

So, when dumping USB data with "cat /dev/usbmon0 > usbmon.trace" while
reading from a USB storage device and analyzing the dump file
afterwards it will get out of sync after a couple of packets.

Signed-off-by: Ingo van Lil <inguin@gmx.de>
Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/mon/mon_bin.c