From c0a13abd6300ecad382a1c528ea4b2d963d02395 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Mon, 30 Mar 2026 13:36:52 +0200 Subject: [PATCH] linux: fix return value in nvme_lookup_key nvme_lookup_key was not correctly updated when switching the error handling code. Fixes: 476de36dcc9f ("linux: add global context as first argument to crypto API") Signed-off-by: Daniel Wagner --- libnvme/src/nvme/linux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libnvme/src/nvme/linux.c b/libnvme/src/nvme/linux.c index f8913e7ea8..fd2271a56b 100644 --- a/libnvme/src/nvme/linux.c +++ b/libnvme/src/nvme/linux.c @@ -959,7 +959,9 @@ __public int nvme_lookup_key(struct nvme_global_ctx *ctx, const char *type, key = keyctl_search(KEY_SPEC_SESSION_KEYRING, type, identity, 0); if (key < 0) return -errno; - return key; + + *keyp = key; + return 0; } __public int nvme_set_keyring(struct nvme_global_ctx *ctx, long key_id)