From 0d2c717fd11a41a578a4370516605066f4371b89 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Tue, 5 Apr 2016 08:05:42 -0400 Subject: [PATCH] Fix: use of uninitialized ret value in lttng_abi_create_event MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes the following compiler warning: /home/jenkins/workspace/lttng-modules_VERSION_param-build/arch/x86-32/src/lttng-modules/lttng-abi.c: In function ‘lttng_abi_create_event’: /home/jenkins/workspace/lttng-modules_VERSION_param-build/arch/x86-32/src/lttng-modules/lttng-abi.c:987:16: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] int event_fd, ret; Signed-off-by: Mathieu Desnoyers --- lttng-abi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lttng-abi.c b/lttng-abi.c index e046520e..c14cc82b 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -1017,6 +1017,7 @@ int lttng_abi_create_event(struct file *channel_file, /* The event holds a reference on the channel */ if (atomic_long_add_unless(&channel_file->f_count, 1, INT_MAX) == INT_MAX) { + ret = -EOVERFLOW; goto refcount_error; } if (event_param->instrumentation == LTTNG_KERNEL_TRACEPOINT -- 2.34.1