]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-loop: fix memory leak in nvme_loop_create_ctrl()
authorWu Bo <wubo40@huawei.com>
Wed, 19 May 2021 05:01:10 +0000 (13:01 +0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 19 May 2021 06:33:42 +0000 (08:33 +0200)
commitb23a35d49542861a1629718f9040b3ee8c84084d
treea7981c1c11732854f82dfcb3ab23e060857f6410
parentca652d5b696f77d27c8176b8d23a0dadd2b6ad68
nvme-loop: fix memory leak in nvme_loop_create_ctrl()

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: 033949c74ab1 ("nvme-loop: add a NVMe loopback host driver")
Signed-off-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/loop.c