libnvme/libnvme-1.10-linux-Fix-uninitialized-variables.patch
Tomas Bzatek db9f0d1804 * Fri May 03 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.9-1
- Upstream v1.9 release

Resolves: RHEL-35387
2024-05-09 16:49:40 +02:00

41 lines
1.3 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From 91f7671ca54a200d652b9b9f34915325313511f5 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Fri, 3 May 2024 17:19:39 +0200
Subject: [PATCH] linux: Fix uninitialized variables
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In file included from ../src/nvme/linux.c:40:
In function freep,
inlined from nvme_get_telemetry_log at ../src/nvme/linux.c:169:23:
../src/nvme/cleanup.h:24:9: warning: log may be used uninitialized [-Wmaybe-uninitialized]
24 | free(*(void **)p);
| ^~~~~~~~~~~~~~~~~
../src/nvme/linux.c: In function nvme_get_telemetry_log:
../src/nvme/linux.c:169:30: note: log was declared here
169 | _cleanup_free_ void *log;
| ^~~
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
---
src/nvme/linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nvme/linux.c b/src/nvme/linux.c
index 25196fd5..35976011 100644
--- a/src/nvme/linux.c
+++ b/src/nvme/linux.c
@@ -166,7 +166,7 @@ int nvme_get_telemetry_log(int fd, bool create, bool ctrl, bool rae, size_t max_
struct nvme_telemetry_log *telem;
enum nvme_cmd_get_log_lid lid;
- _cleanup_free_ void *log;
+ _cleanup_free_ void *log = NULL;
void *tmp;
int err;
size_t dalb;
--
2.44.0