Fix: use of uninitialized ret value in lttng_abi_create_event
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 5 Apr 2016 12:05:42 +0000 (08:05 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 5 Apr 2016 12:05:42 +0000 (08:05 -0400)
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 <mathieu.desnoyers@efficios.com>
lttng-abi.c

index e046520e5f2a34357dbbffed484afc2ca978da9d..c14cc82b2baca8aa6e2012a6f46d8079fa58f2ec 100644 (file)
@@ -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
This page took 0.026301 seconds and 4 git commands to generate.