mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 15:42:32 +00:00
nvme-fc: fix module_init (theoretical) error path
If nvmf_register_transport happened to fail (it can't, but theoretically) we leak memory. Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
This commit is contained in:
parent
d19eef029d
commit
c0e4a6f594
1 changed files with 10 additions and 1 deletions
|
@ -2546,11 +2546,20 @@ static struct nvmf_transport_ops nvme_fc_transport = {
|
||||||
|
|
||||||
static int __init nvme_fc_init_module(void)
|
static int __init nvme_fc_init_module(void)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
nvme_fc_wq = create_workqueue("nvme_fc_wq");
|
nvme_fc_wq = create_workqueue("nvme_fc_wq");
|
||||||
if (!nvme_fc_wq)
|
if (!nvme_fc_wq)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
return nvmf_register_transport(&nvme_fc_transport);
|
ret = nvmf_register_transport(&nvme_fc_transport);
|
||||||
|
if (ret)
|
||||||
|
goto err;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
err:
|
||||||
|
destroy_workqueue(nvme_fc_wq);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit nvme_fc_exit_module(void)
|
static void __exit nvme_fc_exit_module(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue