Commit ad1c8538 authored by Wu Bo's avatar Wu Bo Committed by Zheng Zengkai
Browse files

nvme-loop: fix memory leak in nvme_loop_create_ctrl()



stable inclusion
from stable-5.10.40
commit 9c980795ccd77e8abec33dd6fe28dfe1c4083e65
bugzilla: 51882
CVE: NA

--------------------------------

[ Upstream commit 03504e3b ]

When creating loop ctrl in nvme_loop_create_ctrl(), if nvme_init_ctrl()
fails, the loop ctrl should be freed before jumping to the "out" label.

Fixes: 3a85a5de ("nvme-loop: add a NVMe loopback host driver")
Signed-off-by: default avatarWu Bo <wubo40@huawei.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 5b959e31
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment