You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
RDMA/qedr: clean up work queue on failure in qedr_alloc_resources()
[ Upstream commit7a47e077e5] Add a check for if create_singlethread_workqueue() fails and also destroy the work queue on failure paths. Fixes:e411e0587e("RDMA/qedr: Add iWARP connection management functions") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/Y1gBkDucQhhWj5YM@kili Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d360e875c0
commit
4e1e4485b2
@@ -374,6 +374,10 @@ static int qedr_alloc_resources(struct qedr_dev *dev)
|
||||
if (IS_IWARP(dev)) {
|
||||
xa_init(&dev->qps);
|
||||
dev->iwarp_wq = create_singlethread_workqueue("qedr_iwarpq");
|
||||
if (!dev->iwarp_wq) {
|
||||
rc = -ENOMEM;
|
||||
goto err1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate Status blocks for CNQ */
|
||||
@@ -381,7 +385,7 @@ static int qedr_alloc_resources(struct qedr_dev *dev)
|
||||
GFP_KERNEL);
|
||||
if (!dev->sb_array) {
|
||||
rc = -ENOMEM;
|
||||
goto err1;
|
||||
goto err_destroy_wq;
|
||||
}
|
||||
|
||||
dev->cnq_array = kcalloc(dev->num_cnq,
|
||||
@@ -432,6 +436,9 @@ err3:
|
||||
kfree(dev->cnq_array);
|
||||
err2:
|
||||
kfree(dev->sb_array);
|
||||
err_destroy_wq:
|
||||
if (IS_IWARP(dev))
|
||||
destroy_workqueue(dev->iwarp_wq);
|
||||
err1:
|
||||
kfree(dev->sgid_tbl);
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user