mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq
[ Upstream commit 90a239ee25fa3a483facec3de7c144361a3d3a51 ]
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:
parent
d6fb7f4574
commit
66143ecb9e
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue