[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251218160632.GE400630@unreal>
Date: Thu, 18 Dec 2025 18:06:32 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Wentao Liang <vulab@...as.ac.cn>
Cc: bharat@...lsio.com, jgg@...pe.ca, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] RDMA/cxgb4: fix a memory leak in pass_accept_req() error
path
On Mon, Dec 15, 2025 at 03:56:07PM +0000, Wentao Liang wrote:
> In the alloc_ep_skb_list() failure path, the c4iw_put_ep() is
> incorrectly used instead of the kfree(). Since the child_ep's
> reference count hasn't been properly established at this point,
> the c4iw_put_ep() won't actually free the memory, resulting in
> permanent memory leak.
>
> Fix by releasing child_ep correctly in the fail path.
>
> Fixes: 4a740838bf44 ("RDMA/iw_cxgb4: Low resource fixes for connection manager")
> Cc: stable@...r.kernel.org
> Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
> ---
> drivers/infiniband/hw/cxgb4/cm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
> index b3b45c49077d..a09eeb48775f 100644
> --- a/drivers/infiniband/hw/cxgb4/cm.c
> +++ b/drivers/infiniband/hw/cxgb4/cm.c
> @@ -2665,7 +2665,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
> }
> goto out;
> fail:
> - c4iw_put_ep(&child_ep->com);
> + kfree(child_ep);
You should squash with your previous patch and get Acked-by from cxgb4
maintainers.
Thanks
> reject:
> reject_cr(dev, hwtid, skb);
> out:
> --
> 2.34.1
>
Powered by blists - more mailing lists