]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fix memory leak in nvmet_alloc_ctrl()
authorWu Bo <wubo40@huawei.com>
Wed, 19 May 2021 05:01:09 +0000 (13:01 +0800)
committerChristoph Hellwig <hch@lst.de>
Wed, 19 May 2021 06:33:39 +0000 (08:33 +0200)
commitca652d5b696f77d27c8176b8d23a0dadd2b6ad68
tree8a02dec924fd6f5cbbf6c8ba6e690f38a5b1e760
parentf00ad71e6640a5d9f73a37e5a022be17bfd7de65
nvmet: fix memory leak in nvmet_alloc_ctrl()

When creating ctrl in nvmet_alloc_ctrl(), if the cntlid_min is larger
than cntlid_max of the subsystem, and jumps to the
"out_free_changed_ns_list" label, but the ctrl->sqs lack of be freed.
Fix this by jumping to the "out_free_sqs" label.

Fixes: 1d0701a8ec27 ("nvmet: make ctrl-id configurable")
Signed-off-by: Wu Bo <wubo40@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c