]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet-auth: fix return value check in auth receive
authorChaitanya Kulkarni <kch@nvidia.com>
Mon, 18 Jul 2022 23:12:33 +0000 (16:12 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:51 +0000 (17:22 -0600)
commit4cea5a19b54ba15f71775a615ca6d3f52eeed94a
treeaa5ea25bd67dfa5a496ce6a8f5399e589af30663
parent544c72b92c42890766eb20db5e095b7cf17f8344
nvmet-auth: fix return value check in auth receive

nvmet_auth_challenge() return type is int and currently it uses status
variable that is of type u16 in nvmet_execute_auth_receive().

Catch the return value of nvmet_auth_challenge() into int and set the
NVME_SC_INTERNAL as status variable before we jump to error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/fabrics-cmd-auth.c