nvmet-auth: fix return value check in auth send
authorChaitanya Kulkarni <kch@nvidia.com>
Mon, 18 Jul 2022 23:12:32 +0000 (16:12 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 26 Jul 2022 20:04:23 +0000 (16:04 -0400)
commite63a86f4da08ed614254e6e3fc28d2323199c69c
tree5378e3121174f97aca70f92f0f47b38087a02e32
parentfc5eb70315dc0c4e060fa11b58780c0c59a4ad79
nvmet-auth: fix return value check in auth send

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

Catch the return value of nvmet_setup_auth() 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