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)
committerChristoph Hellwig <hch@lst.de>
Tue, 26 Jul 2022 20:04:24 +0000 (16:04 -0400)
commitf0becfc578c96f2b5b43f856b47cea5c8433800e
treeb81cc4bfbee239af65c7432d430dc8375cf0ca8c
parente63a86f4da08ed614254e6e3fc28d2323199c69c
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>
drivers/nvme/target/fabrics-cmd-auth.c