Message ID | 1537931478-509-1-git-send-email-yanjun.zhu@oracle.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Jason Gunthorpe |
Headers | show |
Series | [PATCHv2,1/1] IB/rxe: replace kvfree with vfree | expand |
On Tue, Sep 25, 2018 at 11:11:18PM -0400, Zhu Yanjun wrote: > The buf is allocated by vmalloc_user in the function rxe_queue_init. > So it is better to free it by vfree. > > Fixes: 8700e3e7c485 ("Soft RoCE driver") > Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> > --- > V1->V2: Add Fixes and fix other similar problems. > --- > drivers/infiniband/sw/rxe/rxe_cq.c | 2 +- > drivers/infiniband/sw/rxe/rxe_qp.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
On Tue, Sep 25, 2018 at 11:11:18PM -0400, Zhu Yanjun wrote: > The buf is allocated by vmalloc_user in the function rxe_queue_init. > So it is better to free it by vfree. > > Fixes: 8700e3e7c485 ("Soft RoCE driver") > Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> > Reviewed-by: Leon Romanovsky <leonro@mellanox.com> > --- > V1->V2: Add Fixes and fix other similar problems. > --- > drivers/infiniband/sw/rxe/rxe_cq.c | 2 +- > drivers/infiniband/sw/rxe/rxe_qp.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) Applied to for-next, thanks Jason
diff --git a/drivers/infiniband/sw/rxe/rxe_cq.c b/drivers/infiniband/sw/rxe/rxe_cq.c index 2ee4b08..406d97e 100644 --- a/drivers/infiniband/sw/rxe/rxe_cq.c +++ b/drivers/infiniband/sw/rxe/rxe_cq.c @@ -97,7 +97,7 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe, err = do_mmap_info(rxe, uresp ? &uresp->mi : NULL, context, cq->queue->buf, cq->queue->buf_size, &cq->queue->ip); if (err) { - kvfree(cq->queue->buf); + vfree(cq->queue->buf); kfree(cq->queue); return err; } diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index c58452d..84f60d4 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -247,7 +247,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, &qp->sq.queue->ip); if (err) { - kvfree(qp->sq.queue->buf); + vfree(qp->sq.queue->buf); kfree(qp->sq.queue); return err; } @@ -300,7 +300,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp, qp->rq.queue->buf, qp->rq.queue->buf_size, &qp->rq.queue->ip); if (err) { - kvfree(qp->rq.queue->buf); + vfree(qp->rq.queue->buf); kfree(qp->rq.queue); return err; }
The buf is allocated by vmalloc_user in the function rxe_queue_init. So it is better to free it by vfree. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com> --- V1->V2: Add Fixes and fix other similar problems. --- drivers/infiniband/sw/rxe/rxe_cq.c | 2 +- drivers/infiniband/sw/rxe/rxe_qp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)