Skip to content
Commit 9b1ebce6 authored by Su Hui's avatar Su Hui Committed by Jens Axboe
Browse files

block: sed-opal: avoid possible wrong address reference in read_sed_opal_key()

Clang static checker (scan-build) warning:
block/sed-opal.c:line 317, column 3
Value stored to 'ret' is never read.

Fix this problem by returning the error code when keyring_search() failed.
Otherwise, 'key' will have a wrong value when 'kerf' stores the error code.

Fixes: 3bfeb612

 ("block: sed-opal: keyring support for SED keys")
Signed-off-by: default avatarSu Hui <suhui@nfschina.com>
Link: https://lore.kernel.org/r/20240611073659.429582-1-suhui@nfschina.com
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 27d02423
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment