Skip to content

Commit

Permalink
linux: Correct error handling for derive_psk_digest
Browse files Browse the repository at this point in the history
Treat only negative return values are errors.

Signed-off-by: Prashanth Nayak <[email protected]>
  • Loading branch information
prashanth-nayak authored and igaw committed Aug 7, 2024
1 parent 55e29b8 commit 9967817
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nvme/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ static int derive_nvme_keys(const char *hostnqn, const char *subsysnqn,
ret = derive_psk_digest(hostnqn, subsysnqn, version, hmac,
retained, key_len,
digest, digest_len);
if (ret)
if (ret < 0)
return ret;
context = digest;
}
Expand Down

0 comments on commit 9967817

Please sign in to comment.