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)) {
rpages->p[index].virt + (offset & ~PAGE_MASK),
src, len);
if (unlikely(ret > 0)) {
- len -= (pagecpy - ret);
- offset += (pagecpy - ret);
goto fill_buffer;
}
} else {
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.
/*
* 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,
*/
static inline
unsigned long lib_ring_buffer_do_copy_from_user_inatomic(void *dest,
+ (offset & ~PAGE_MASK),
src, pagecpy) != 0;
if (ret > 0) {
+ (offset & ~PAGE_MASK),
src, pagecpy) != 0;
if (ret > 0) {
- offset += (pagecpy - ret);
- len -= (pagecpy - ret);
_lib_ring_buffer_memset(bufb, offset, 0, len, 0);
break; /* stop copy */
}
_lib_ring_buffer_memset(bufb, offset, 0, len, 0);
break; /* stop copy */
}