X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-abi.c;h=64364794718b5ab2756b068fe95108893211d27f;hb=97192ed64d98b2070da2c78f0a32179b91e969d4;hp=1be6802a0f3c511677048e578476b71785e113d4;hpb=040b4761a1eea72a9ad320ba42fc5d7b6977a624;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index 1be6802a..64364794 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" @@ -900,8 +901,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;