X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=lttng-context-perf-counters.c;h=20d49d580760b8c4ed8cd15ce239bb6c2d77b17b;hb=f5cf8eff6312d07b6e2cf012e04fce554613a748;hp=e9a57888c4db8b1d818e76c17c1e10d9421809c4;hpb=c24a0d710f6aac1484bd02bb6375e8de7429edd0;p=lttng-modules.git diff --git a/lttng-context-perf-counters.c b/lttng-context-perf-counters.c index e9a57888..20d49d58 100644 --- a/lttng-context-perf-counters.c +++ b/lttng-context-perf-counters.c @@ -107,13 +107,15 @@ int lttng_add_perf_counter_to_ctx(uint32_t type, cpu, NULL, overflow_callback); if (!events[cpu]) { ret = -EINVAL; - goto error; + goto name_alloc_error; } } name_alloc = kstrdup(name, GFP_KERNEL); - if (!field->event_field.name) + if (!name_alloc) { + ret = -ENOMEM; goto name_alloc_error; + } field = lttng_append_context(ctx); if (!field) {