[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <809fbf8a-e37d-2e92-cecb-37653e38290c@embeddedor.com>
Date: Fri, 8 Jun 2018 18:11:49 -0500
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Raed Salem <raeds@...lanox.com>, Leon Romanovsky <leon@...nel.org>,
Doug Ledford <dledford@...hat.com>, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IB/mlx5: Fix memory leak in mlx5_ib_create_flow
>>
>> mutex_lock(&dev->flow_db->lock);
>>
>> @@ -3640,6 +3646,9 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp,
>> kfree(ucmd);
>> kfree(handler);
>> return ERR_PTR(err);
>> +free_ucmd:
>> + kfree(ucmd);
>> + return ERR_PTR(err);
>> }
>
> This hunk is a bit wonky, can we do this instead? handle never needs
> to be freed.
>
> destroy_ft:
> put_flow_table(dev, ft_prio, false);
> if (ft_prio_tx)
> put_flow_table(dev, ft_prio_tx, false);
> unlock:
> mutex_unlock(&dev->flow_db->lock);
> kfree(dst);
> free_ucmd:
> kfree(ucmd);
> return ERR_PTR(err);
> }
>
>
Sure thing. I'll send v2 shortly.
Thanks for the feedback.
--
Gustavo
Powered by blists - more mailing lists