summaryrefslogtreecommitdiff
path: root/drivers/usb/mon/mon_bin.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-08 17:07:49 +0300
committerIngo Molnar <mingo@elte.hu>2008-12-08 17:07:49 +0300
commitaa9c9b8c584a42a094202b7e0f63497e888f86a7 (patch)
tree3cb3b022054a7c1722657288518f495e0c4d9983 /drivers/usb/mon/mon_bin.c
parent87f7606591aea6a8a38ea4c8911b5eeeee2740b8 (diff)
parent218d11a8b071b23b76c484fd5f72a4fe3306801e (diff)
downloadlinux-aa9c9b8c584a42a094202b7e0f63497e888f86a7.tar.xz
Merge branch 'linus' into x86/quirks
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,
}
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)