aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon/mon_bin.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-11-20 16:53:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-20 16:53:21 -0500
commitba721d318b24154eb7806a8673d3fc030fd39f7e (patch)
treebb83fc812e726882b8bbf62579872ae8b8e8ace3 /drivers/usb/mon/mon_bin.c
parent0ca4b6b00113b064c080d26d803d0d7c80fb5dc8 (diff)
parent5091b58751d9bf51e92aa9e07f3332dcacc2af1c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: USB: ACE1001 patch for cp2101.c USB: usbmon: fix read(2) USB: gadget rndis: send notifications USB: gadget rndis: stop windows self-immolation USB: storage: update unusual_devs entries for Nokia 5300 and 5310 USB: storage: updates unusual_devs entry for the Nokia 6300 usb: musb: fix bug in musb_schedule USB: fix SB700 usb subsystem hang bug
Diffstat (limited to 'drivers/usb/mon/mon_bin.c')
-rw-r--r--drivers/usb/mon/mon_bin.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index c9de3f027aab..e06810aef2df 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -687,7 +687,10 @@ static ssize_t mon_bin_read(struct file *file, char __user *buf,
687 } 687 }
688 688
689 if (rp->b_read >= sizeof(struct mon_bin_hdr)) { 689 if (rp->b_read >= sizeof(struct mon_bin_hdr)) {
690 step_len = min(nbytes, (size_t)ep->len_cap); 690 step_len = ep->len_cap;
691 step_len -= rp->b_read - sizeof(struct mon_bin_hdr);
692 if (step_len > nbytes)
693 step_len = nbytes;
691 offset = rp->b_out + PKT_SIZE; 694 offset = rp->b_out + PKT_SIZE;
692 offset += rp->b_read - sizeof(struct mon_bin_hdr); 695 offset += rp->b_read - sizeof(struct mon_bin_hdr);
693 if (offset >= rp->b_size) 696 if (offset >= rp->b_size)