* mlx5: memory leaks
@ 2022-01-13 4:37 Ryan Cai
2022-01-14 9:10 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Ryan Cai @ 2022-01-13 4:37 UTC (permalink / raw)
To: leon, jgg; +Cc: linux-rdma, linux-kernel
Hi, Kernel Maintainers,
In method mlx5_ib_destroy_gsi of gsi.c, there are memory leaks when ret = ib_destroy_qp(gsi->rx_qp); returns true? I think, ib_free_cq(gsi->cq); kfree(gsi->outstanding_wrs); kfree(gsi->tx_qps); should also be put before return ret before Line 180. If this is a real bug, I can send a patch. Thanks!
Locations: https://github.com/torvalds/linux/blob/master/drivers/infiniband/hw/mlx5/gsi.c#L168-L197
Best,
Ryan
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: mlx5: memory leaks
2022-01-13 4:37 mlx5: memory leaks Ryan Cai
@ 2022-01-14 9:10 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2022-01-14 9:10 UTC (permalink / raw)
To: Ryan Cai; +Cc: jgg, linux-rdma, linux-kernel
On Thu, Jan 13, 2022 at 12:37:10PM +0800, Ryan Cai wrote:
> Hi, Kernel Maintainers,
>
> In method mlx5_ib_destroy_gsi of gsi.c, there are memory leaks when ret = ib_destroy_qp(gsi->rx_qp); returns true? I think, ib_free_cq(gsi->cq); kfree(gsi->outstanding_wrs); kfree(gsi->tx_qps); should also be put before return ret before Line 180. If this is a real bug, I can send a patch. Thanks!
The ib_destroy_qp() is function that destroys kernel QP that in our
memory model shouldn't fail. The patch that converts ib_destroy_qp()
to be void is very welcomed.
See ib_destroy_srq() as an example of expected function format.
Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-14 9:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-13 4:37 mlx5: memory leaks Ryan Cai
2022-01-14 9:10 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox