Skip to content

Commit 27f8dde

Browse files
committed
linux: fix return value in nvme_lookup_key
nvme_lookup_key was not correctly updated when switching the error handling code. Fixes: 476de36 ("linux: add global context as first argument to crypto API") Signed-off-by: Daniel Wagner <[email protected]>
1 parent 4037866 commit 27f8dde

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

libnvme/src/nvme/linux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,9 @@ __public int nvme_lookup_key(struct nvme_global_ctx *ctx, const char *type,
959959
key = keyctl_search(KEY_SPEC_SESSION_KEYRING, type, identity, 0);
960960
if (key < 0)
961961
return -errno;
962-
return key;
962+
963+
*keyp = key;
964+
return 0;
963965
}
964966

965967
__public int nvme_set_keyring(struct nvme_global_ctx *ctx, long key_id)

0 commit comments

Comments
 (0)