if (validate_zeroed_padding(local_counter_read.padding,
sizeof(local_counter_read.padding)))
return -EINVAL;
+ if (local_counter_read.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX)
+ return -EINVAL;
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_read.index.number_dimensions; i++)
if (validate_zeroed_padding(local_counter_aggregate.padding,
sizeof(local_counter_aggregate.padding)))
return -EINVAL;
+ if (local_counter_aggregate.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX)
+ return -EINVAL;
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_aggregate.index.number_dimensions; i++)
if (validate_zeroed_padding(local_counter_clear.padding,
sizeof(local_counter_clear.padding)))
return -EINVAL;
+ if (local_counter_clear.index.number_dimensions > LTTNG_KERNEL_ABI_COUNTER_DIMENSION_MAX)
+ return -EINVAL;
/* Cast all indexes into size_t. */
for (i = 0; i < local_counter_clear.index.number_dimensions; i++)
return lttng_kernel_counter_clear(counter, indexes);
}
default:
- WARN_ON_ONCE(1);
return -ENOSYS;
}
}
/* Finish copy of previous record */
if (*ppos != 0) {
- if (read_count < count) {
+ if (count != 0) {
len = chan->iter.len_left;
read_offset = *ppos;
goto skip_get_next;
chan->iter.len_left = 0;
put_record:
- lib_ring_buffer_put_current_record(buf);
+ if (*ppos == 0)
+ lib_ring_buffer_put_current_record(buf);
return read_count;
}
* will stay invariant for the rest of the session.
*/
event = lttng_kernel_event_create(&event_enabler->parent, NULL);
- WARN_ON_ONCE(!event);
+ WARN_ON_ONCE(IS_ERR(event));
lttng_event_enabler_destroy(&event_enabler->parent);
if (IS_ERR(event)) {
ret = PTR_ERR(event);
goto event_notifier_error;
}
event = lttng_kernel_event_create(&event_notifier_enabler->parent, NULL);
- WARN_ON_ONCE(!event);
+ WARN_ON_ONCE(IS_ERR(event));
lttng_event_enabler_destroy(&event_notifier_enabler->parent);
if (IS_ERR(event)) {
ret = PTR_ERR(event);