|
@@ -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)
|