From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Bo Sun <bo@mboxify.com>
Cc: <kuba@kernel.org>, <pabeni@redhat.com>, <sgoutham@marvell.com>,
<lcherian@marvell.com>, <gakula@marvell.com>,
<jerinj@marvell.com>, <hkelam@marvell.com>, <sbhatta@marvell.com>,
<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH net 1/1] octeontx2-af: CGX: fix bitmap leaks
Date: Mon, 20 Oct 2025 17:45:41 +0200 [thread overview]
Message-ID: <7cf5475d-b257-4595-b306-53952c8a63b7@intel.com> (raw)
In-Reply-To: <20251020143112.357819-2-bo@mboxify.com>
From: Bo Sun <bo@mboxify.com>
Date: Mon, 20 Oct 2025 22:31:12 +0800
> The RX/TX flow-control bitmaps (rx_fc_pfvf_bmap and tx_fc_pfvf_bmap)
> are allocated by cgx_lmac_init() but never freed in cgx_lmac_exit().
> Unbinding and rebinding the driver therefore triggers kmemleak:
>
> unreferenced object (size 16):
> backtrace:
> rvu_alloc_bitmap
> cgx_probe
>
> Free both bitmaps during teardown.
>
> Fixes: e740003874ed ("octeontx2-af: Flow control resource management")
> Cc: stable@vger.kernel.org
> Signed-off-by: Bo Sun <bo@mboxify.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---
> drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> index ec0e11c77cbf..f56e6782c4de 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
> @@ -1823,6 +1823,8 @@ static int cgx_lmac_exit(struct cgx *cgx)
> cgx->mac_ops->mac_pause_frm_config(cgx, lmac->lmac_id, false);
> cgx_configure_interrupt(cgx, lmac, lmac->lmac_id, true);
> kfree(lmac->mac_to_index_bmap.bmap);
> + kfree(lmac->rx_fc_pfvf_bmap.bmap);
> + kfree(lmac->tx_fc_pfvf_bmap.bmap);
> kfree(lmac->name);
> kfree(lmac);
> }
Thanks,
Olek
next prev parent reply other threads:[~2025-10-20 15:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 14:31 [PATCH net 0/1] octeontx2-af: CGX: fix bitmap leaks Bo Sun
2025-10-20 14:31 ` [PATCH net 1/1] " Bo Sun
2025-10-20 15:45 ` Alexander Lobakin [this message]
2025-10-23 1:22 ` Jakub Kicinski
2026-02-05 13:35 ` Bo Sun
2026-02-05 15:48 ` Jakub Kicinski
2026-02-06 10:09 ` bo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7cf5475d-b257-4595-b306-53952c8a63b7@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=bo@mboxify.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gakula@marvell.com \
--cc=hkelam@marvell.com \
--cc=jerinj@marvell.com \
--cc=kuba@kernel.org \
--cc=lcherian@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sbhatta@marvell.com \
--cc=sgoutham@marvell.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox