nvmet: fix memory leak in nvmet_alloc_ctrl()
[ Upstream commitfec356a61a] 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:94a39d61f8("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
737ccd2134
commit
4720f29acb
1 changed files with 1 additions and 1 deletions
|
|
@ -1360,7 +1360,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
|
|||
goto out_free_changed_ns_list;
|
||||
|
||||
if (subsys->cntlid_min > subsys->cntlid_max)
|
||||
goto out_free_changed_ns_list;
|
||||
goto out_free_sqs;
|
||||
|
||||
ret = ida_simple_get(&cntlid_ida,
|
||||
subsys->cntlid_min, subsys->cntlid_max,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue