X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=1cc9510110dbc216ecf02c4ca8157dfc8f12a78e;hb=abc0446a8da1fe7cc09a546389cbcc932b265520;hp=a373504c26d0d7804e22cafb4e0dcac3747212a9;hpb=ae7345475575f3b6610e29d81131d27beea1e3d1;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index a373504c..1cc95101 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "wrapper/ringbuffer/vfs.h" #include "wrapper/ringbuffer/backend.h" @@ -912,8 +913,9 @@ int lttng_abi_create_event(struct file *channel_file, * will stay invariant for the rest of the session. */ event = lttng_event_create(channel, event_param, NULL, NULL); - if (!event) { - ret = -EINVAL; + WARN_ON_ONCE(!event); + if (IS_ERR(event)) { + ret = PTR_ERR(event); goto event_error; } event_file->private_data = event;