]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
nvme-core: fix memory leak in dhchap_ctrl_secret
authorChaitanya Kulkarni <kch@nvidia.com>
Fri, 28 Apr 2023 07:31:13 +0000 (00:31 -0700)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:30 +0000 (17:19 +0200)
commit571624f021484e22dc791b4bcd917ea9589fd05d
tree257751ceddd17853d0592c46927d9cb431dd94a9
parent552fa381cbf30f7f493b8628d4675ec32e4c77fe
nvme-core: fix memory leak in dhchap_ctrl_secret

BugLink: https://bugs.launchpad.net/bugs/2034469
[ Upstream commit 99c2dcc8ffc24e210a3aa05c204d92f3ef460b05 ]

Free dhchap_secret in nvme_ctrl_dhchap_ctrl_secret_store() before we
return when nvme_auth_generate_key() returns error.

Fixes: f50fff73d620 ("nvme: implement In-Band authentication")
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/nvme/host/core.c