From: Francis Deslauriers Date: Wed, 8 Mar 2017 19:32:31 +0000 (-0500) Subject: Fix: use of uninitialized ret value in lttng_abi_open_metadata_stream X-Git-Tag: v2.8.5~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=755d8a6f1fc1a00d47fd40a2bb441b479bcc3ab9;p=lttng-modules.git Fix: use of uninitialized ret value in lttng_abi_open_metadata_stream Fixes the following compiler warning: lttng-abi.c: In function ‘lttng_metadata_ioctl’: lttng-abi.c:971:6: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] int ret; ^ Signed-off-by: Francis Deslauriers Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-abi.c b/lttng-abi.c index 4dd9273f..397e1de6 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -996,8 +996,11 @@ int lttng_abi_open_metadata_stream(struct file *channel_file) goto notransport; } - if (!lttng_kref_get(&session->metadata_cache->refcount)) + if (!lttng_kref_get(&session->metadata_cache->refcount)) { + ret = -EOVERFLOW; goto kref_error; + } + ret = lttng_abi_create_stream_fd(channel_file, stream_priv, <tng_metadata_ring_buffer_file_operations); if (ret < 0)