Message ID | 1435268892-22935-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Accepted |
Commit | 828f2e54799dd6f0f277aa125fbb325f48da9362 |
Headers | show |
Merged, Thanks, Maxim. On 06/26/15 00:48, Bill Fischofer wrote: > Fix for Bug https://bugs.linaro.org/show_bug.cgi?id=1661 > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > --- > platform/linux-generic/include/odp_buffer_inlines.h | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h > index 91e56bd..74af38b 100644 > --- a/platform/linux-generic/include/odp_buffer_inlines.h > +++ b/platform/linux-generic/include/odp_buffer_inlines.h > @@ -182,7 +182,9 @@ static inline void *segment_map(odp_buffer_hdr_t *buf, > /* Set seglen if caller is asking for it */ > if (seglen != NULL) { > buf_left = limit - seg_offset; > - *seglen = buf_left < buf->segsize ? buf_left : buf->segsize; > + *seglen = buf_left < buf->segsize ? buf_left : > + (seg_offset >= buf->segsize ? buf->segsize : > + buf->segsize - seg_offset); > } > > return (void *)seg_addr;
diff --git a/platform/linux-generic/include/odp_buffer_inlines.h b/platform/linux-generic/include/odp_buffer_inlines.h index 91e56bd..74af38b 100644 --- a/platform/linux-generic/include/odp_buffer_inlines.h +++ b/platform/linux-generic/include/odp_buffer_inlines.h @@ -182,7 +182,9 @@ static inline void *segment_map(odp_buffer_hdr_t *buf, /* Set seglen if caller is asking for it */ if (seglen != NULL) { buf_left = limit - seg_offset; - *seglen = buf_left < buf->segsize ? buf_left : buf->segsize; + *seglen = buf_left < buf->segsize ? buf_left : + (seg_offset >= buf->segsize ? buf->segsize : + buf->segsize - seg_offset); } return (void *)seg_addr;
Fix for Bug https://bugs.linaro.org/show_bug.cgi?id=1661 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/include/odp_buffer_inlines.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)