Commit fd528a86 authored by Wu Bo's avatar Wu Bo Committed by Li Nan
Browse files

nvme-loop: fix memory leak in nvme_loop_create_ctrl()

mainline inclusion
from mainline-v5.13-rc3
commit 03504e3b
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I956G7
CVE: CVE-2021-47074

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=03504e3b54cc8118cc26c064e60a0b00c2308708



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

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>

Conflict:
	In mainline, commit 64d452b3 and b6cec06d changed
	context. Does not affect the logic of this patch.

Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent d0ba42ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment