mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq
[ Upstream commit90a239ee25] In case of failure of alloc_ud_wq_attr(), the memory allocated by rvt_alloc_rq() is not freed. Fix it by calling rvt_free_rq() using the existing clean-up code. Fixes:d310c4bf8a("IB/{rdmavt, hfi1, qib}: Remove AH refcount for UD QPs") Link: https://lore.kernel.org/r/20200614041148.131983-1-pakki001@umn.edu Signed-off-by: Aditya Pakki <pakki001@umn.edu> Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Sasha Levin
parent
d6fb7f4574
commit
66143ecb9e
@@ -1196,7 +1196,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
|
||||
err = alloc_ud_wq_attr(qp, rdi->dparms.node);
|
||||
if (err) {
|
||||
ret = (ERR_PTR(err));
|
||||
goto bail_driver_priv;
|
||||
goto bail_rq_rvt;
|
||||
}
|
||||
|
||||
err = alloc_qpn(rdi, &rdi->qp_dev->qpn_table,
|
||||
@@ -1300,9 +1300,11 @@ bail_qpn:
|
||||
rvt_free_qpn(&rdi->qp_dev->qpn_table, qp->ibqp.qp_num);
|
||||
|
||||
bail_rq_wq:
|
||||
rvt_free_rq(&qp->r_rq);
|
||||
free_ud_wq_attr(qp);
|
||||
|
||||
bail_rq_rvt:
|
||||
rvt_free_rq(&qp->r_rq);
|
||||
|
||||
bail_driver_priv:
|
||||
rdi->driver_f.qp_priv_free(rdi, qp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user