If the ring_buffer reserve in synth_event_trace_start() fails, the matching ring_buffer_nest_end() should be called in the error code, since nothing else will ever call it in this case. Link: http://lkml.kernel.org/r/20abc444b3eeff76425f895815380abe7aa53ff8.1581374549.git.zanussi@kernel.org
Showing the changes to kernel (1 of 1 file). Show all
Unified · Split
| @@ -2043,6 +2043,7 @@ int synth_event_trace_start(struct trace_event_file *file, · 2042 unmodified lines | ||
| 2043 | 2043 | entry = trace_event_buffer_reserve(&trace_state->fbuffer, file, |
| 2044 | 2044 | sizeof(*entry) + fields_size); |
| 2045 | 2045 | if (!entry) { |
| 2046 | + ring_buffer_nest_end(trace_state->buffer); | |
| 2046 | 2047 | ret = -EINVAL; |
| 2047 | 2048 | goto out; |
| 2048 | 2049 | } |