You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libnvme/SOURCES/libnvme-1.10-linux-Fix-unin...

41 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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