diff mbox series

[1/1] IB/rxe: replace kvfree with vfree

Message ID 1537877727-11394-1-git-send-email-yanjun.zhu@oracle.com (mailing list archive)
State Changes Requested
Headers show
Series [1/1] IB/rxe: replace kvfree with vfree | expand

Commit Message

Zhu Yanjun Sept. 25, 2018, 12:15 p.m. UTC
The buf is allocated by vmalloc_user in the function rxe_queue_init.
So it is better to free it by vfree.

Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
---
 drivers/infiniband/sw/rxe/rxe_qp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leon Romanovsky Sept. 25, 2018, 5:42 p.m. UTC | #1
On Tue, Sep 25, 2018 at 08:15:27AM -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.
>
> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
> ---
>  drivers/infiniband/sw/rxe/rxe_qp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
> index c58452d..75f6469 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);

You need the same change in rxe_qp_init_resp()

>  		kfree(qp->sq.queue);
>  		return err;
>  	}
> --
> 2.7.4
>
Zhu Yanjun Sept. 26, 2018, 2:28 a.m. UTC | #2
On 2018/9/26 1:42, Leon Romanovsky wrote:
> On Tue, Sep 25, 2018 at 08:15:27AM -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.
>>
>> Signed-off-by: Zhu Yanjun <yanjun.zhu@oracle.com>
>> ---
>>   drivers/infiniband/sw/rxe/rxe_qp.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
>> index c58452d..75f6469 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);
> You need the same change in rxe_qp_init_resp()
OK. I will send V2 patch to include this.

Zhu Yanjun
>
>>   		kfree(qp->sq.queue);
>>   		return err;
>>   	}
>> --
>> 2.7.4
>>
diff mbox series

Patch

diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c
index c58452d..75f6469 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;
 	}