summaryrefslogtreecommitdiff
path: root/drivers/usb/mon
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-04 08:52:14 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-04 08:52:14 +0100
commitcb9c34e6d090d376b77becaa5d29a65dec7f4272 (patch)
tree3678abce20d6825aebe3fec218057d4131e13fd6 /drivers/usb/mon
parent470c66239ef0336429b35345f3f615d47341e13b (diff)
parent061e41fdb5047b1fb161e89664057835935ca1d2 (diff)
Merge commit 'v2.6.28-rc7' into core/locking
Diffstat (limited to 'drivers/usb/mon')
-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,
}
if (rp->b_read >= sizeof(struct mon_bin_hdr)) {
- step_len = min(nbytes, (size_t)ep->len_cap);
+ step_len = ep->len_cap;
+ step_len -= rp->b_read - sizeof(struct mon_bin_hdr);
+ if (step_len > nbytes)
+ step_len = nbytes;
offset = rp->b_out + PKT_SIZE;
offset += rp->b_read - sizeof(struct mon_bin_hdr);
if (offset >= rp->b_size)