It should treat nonzero return value of
lib_ring_buffer_do_copy_from_user_inatomic() as errors, 0 as success.
It is currently unused by the instrumentation.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rpages->p[index].virt + (offset & ~PAGE_MASK),
src, len);
if (unlikely(ret > 0)) {
- len -= (pagecpy - ret);
- offset += (pagecpy - ret);
+ /* Copy failed. */
goto fill_buffer;
}
} else {
/*
* We use __copy_from_user_inatomic to copy userspace data since we already
* did the access_ok for the whole range.
+ *
+ * Return 0 if OK, nonzero on error.
*/
static inline
unsigned long lib_ring_buffer_do_copy_from_user_inatomic(void *dest,
+ (offset & ~PAGE_MASK),
src, pagecpy) != 0;
if (ret > 0) {
- offset += (pagecpy - ret);
- len -= (pagecpy - ret);
+ /* Copy failed. */
_lib_ring_buffer_memset(bufb, offset, 0, len, 0);
break; /* stop copy */
}