libnvme/libnvme-1.8.0-initialize_autoclean_vars-2.patch
Tomas Bzatek 2f6b05f4a7 * Fri Feb 09 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.7.1-4
- nbft: Fix SSNS HFI indexes parsing
- cleanup: Explicitly initialize auto-cleanup variables
2024-02-09 17:43:02 +01:00

38 lines
1.2 KiB
Diff

From 74324a4120a44120556af41eb9480c5b2492d1fb Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Fri, 9 Feb 2024 17:38:45 +0100
Subject: [PATCH] linux: Explicitly initialize auto-cleanup variables
gcc complains about potentially uninitialized variables.
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
---
src/nvme/linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nvme/linux.c b/src/nvme/linux.c
index f0723193..e29d9e72 100644
--- a/src/nvme/linux.c
+++ b/src/nvme/linux.c
@@ -725,7 +725,7 @@ int nvme_gen_dhchap_key(char *hostnqn, enum nvme_hmac_alg hmac,
unsigned char *key)
{
const char hmac_seed[] = "NVMe-over-Fabrics";
- _cleanup_hmac_ctx_ HMAC_CTX *hmac_ctx;
+ _cleanup_hmac_ctx_ HMAC_CTX *hmac_ctx = NULL;
const EVP_MD *md;
ENGINE_load_builtin_engines();
@@ -881,7 +881,7 @@ int nvme_gen_dhchap_key(char *hostnqn, enum nvme_hmac_alg hmac,
{
const char hmac_seed[] = "NVMe-over-Fabrics";
OSSL_PARAM params[2], *p = params;
- _cleanup_ossl_lib_ctx_ OSSL_LIB_CTX *lib_ctx;
+ _cleanup_ossl_lib_ctx_ OSSL_LIB_CTX *lib_ctx = NULL;
_cleanup_evp_mac_ctx_ EVP_MAC_CTX *mac_ctx = NULL;
_cleanup_evp_mac_ EVP_MAC *mac = NULL;
char *progq = NULL;
--
2.43.0