]> www.infradead.org Git - nvme.git/commit
nvmet-auth: fix nvmet_auth hash error handling nvme-6.11-2024-07-08
authorGaosheng Cui <cuigaosheng1@huawei.com>
Sat, 6 Jul 2024 06:46:25 +0000 (14:46 +0800)
committerKeith Busch <kbusch@kernel.org>
Mon, 8 Jul 2024 17:28:16 +0000 (10:28 -0700)
commit89f58f96d1e2357601c092d85b40a2109cf25ef3
treefe1b5e2b47945343556be6e42a2e97972edc3944
parent18f03a063d41a90115373dc41c1fc22bd3e0a6ad
nvmet-auth: fix nvmet_auth hash error handling

If we fail to call nvme_auth_augmented_challenge, or fail to kmalloc
for shash, we should free the memory allocation for challenge, so add
err path out_free_challenge to fix the memory leak.

Fixes: 7a277c37d352 ("nvmet-auth: Diffie-Hellman key exchange support")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/auth.c