[PATCH] RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In case of failure of alloc_ud_wq_attr, the memory allocated by
rvt_alloc_rq() is not freed. The patch fixes this issue by
calling rvt_free_rq().

Signed-off-by: Aditya Pakki <pakki001@xxxxxxx>
---
 drivers/infiniband/sw/rdmavt/qp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 511b72809e14..17ea7da73bf9 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -1203,6 +1203,7 @@ struct ib_qp *rvt_create_qp(struct ib_pd *ibpd,
 			qp->s_flags = RVT_S_SIGNAL_REQ_WR;
 		err = alloc_ud_wq_attr(qp, rdi->dparms.node);
 		if (err) {
+			rvt_free_rq(&qp->r_rq);
 			ret = (ERR_PTR(err));
 			goto bail_driver_priv;
 		}
-- 
2.25.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux