Fix: use of uninitialized ret value in lttng_abi_open_metadata_stream
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 8 Mar 2017 19:32:31 +0000 (14:32 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 8 Mar 2017 19:38:01 +0000 (14:38 -0500)
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 <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-abi.c

index e193f4377734d1a47a8d881125de8d93befe0cc3..478a5912f89a0ebee71185885119bd3d85e1aff1 100644 (file)
@@ -998,8 +998,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,
                        &lttng_metadata_ring_buffer_file_operations);
        if (ret < 0)
This page took 0.026895 seconds and 4 git commands to generate.