Re: [PATCH] IB/rdmavt: free the userspace memory region with kfree instead of vfree

From: Dalessandro, Dennis
Date: Tue Sep 13 2016 - 08:44:38 EST


On Fri, 2016-09-09 at 08:15 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>
> The userspace memory region 'mr' is allocated with kzalloc in
> __rvt_alloc_mrÂÂhowever it is incorrectly being freed with vfree in
> __rvt_free_mr. Fix this by using kfree to free it.
>
> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
> ---
> Âdrivers/infiniband/sw/rdmavt/mr.c | 2 +-
> Â1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/sw/rdmavt/mr.c
> b/drivers/infiniband/sw/rdmavt/mr.c
> index 80c4b6b..46b6497 100644
> --- a/drivers/infiniband/sw/rdmavt/mr.c
> +++ b/drivers/infiniband/sw/rdmavt/mr.c
> @@ -294,7 +294,7 @@ static void __rvt_free_mr(struct rvt_mr *mr)
> Â{
> Â rvt_deinit_mregion(&mr->mr);
> Â rvt_free_lkey(&mr->mr);
> - vfree(mr);
> + kfree(mr);
> Â}
> Â
> Â/**

Thanks!

Acked-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>