From nobody Sat Feb 7 18:28:39 2026 Received: from mail-108-mta30.mxroute.com (mail-108-mta30.mxroute.com [136.175.108.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1522439448B for ; Fri, 6 Feb 2026 13:10:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770383403; cv=none; b=qqgp8q3Ez2XP4UNTv2qaI1RwQV4xpKWeSGVwx3brSu+R+dPxQnSvwsXt9R/Or0ZY6DzOUfgbU0fQBNIeIii9vL3qFFuQ3aSn07fQse1lgGvOrezr7zp7l6Z/cPfi/LoOJIO3z9MJ8jkY//msQaH28wIG+1qvStml2KfnXqWJwFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770383403; c=relaxed/simple; bh=pVE8CY0vlfW3Mb57nmMnjNNvBzYcywHtHiuhIJtvSU8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=agTgTDFpYaniy+prhGXBc1kYzvS26zsr5RSAi4LThO/afnS6jWIjKFwCOXShJzePqko7j9sp3EgJeCGvU94afvQpyTShXjIGpGKh1imQKs4IsPEOS4rq9aPxWsWZkY1Ti0G3+vcWO0DpqV5p8zGq1tY5Bkt2pfdLIml25tR1TLU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com; spf=pass smtp.mailfrom=mboxify.com; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b=B3j/3x5N; arc=none smtp.client-ip=136.175.108.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mboxify.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b="B3j/3x5N" Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta30.mxroute.com (ZoneMTA) with ESMTPSA id 19c3312ba260009140.00d for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Feb 2026 13:09:51 +0000 X-Zone-Loop: 6b4ab1dc7aaeefb3612845c8aea144b7837bd357040f DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mboxify.com ; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=fjermjITUCTuIJl1tKMjCFnYuxvivj1nC4sLm0pFRbQ=; b=B3j/3x5NOWqIlQVmDbM1qBeLcq aFnQy4wZc1Vxwq5WZUqXKQQcRhnYH+kMQTyA/IEWf1dToM/4iEAMTNvJ6P7GjIsx6J9sHX7eYlcxk iKMngCZ2LsR+OxJactL3aQDBNA1nBViUU944G8T1Kt1eQeCPNd0cRHyOfi+lWyE2LjRjnSOzQzsL4 +5IOc2NquE0H2f9sz9syEfCqU0FezmfBT5LySpMaD9tsBsjvNJETi7gPHR4m4jUI9CfvhhIZ9s6Sl OoNx5CyVqaRaCSv/6JAVYdmRrpizr5p/3LMN2Tr8yhcVt+tHMULYL1LciGJlKvpFXEQfXSp7AVTPH tJwBCI2A==; From: Bo Sun To: kuba@kernel.org, pabeni@redhat.com Cc: gakula@marvell.com, sgoutham@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, horms@kernel.org, bbhushan2@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, sumang@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bo Sun , stable@vger.kernel.org Subject: [PATCH net v2 1/2] octeontx2-af: CGX: fix bitmap leaks Date: Fri, 6 Feb 2026 21:09:24 +0800 Message-Id: <20260206130925.1087588-2-bo@mboxify.com> In-Reply-To: <20260206130925.1087588-1-bo@mboxify.com> References: <20260206130925.1087588-1-bo@mboxify.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: bo@mboxify.com Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Vadim Fedorenko --- 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 42044cd810b1..fd4792e432bf 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); + rvu_free_bitmap(&lmac->rx_fc_pfvf_bmap); + rvu_free_bitmap(&lmac->tx_fc_pfvf_bmap); kfree(lmac->name); kfree(lmac); } From nobody Sat Feb 7 18:28:39 2026 Received: from mail-108-mta105.mxroute.com (mail-108-mta105.mxroute.com [136.175.108.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ABEE03D3D0B for ; Fri, 6 Feb 2026 13:10:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=136.175.108.105 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770383408; cv=none; b=PAgXFz2Zfk5k82B7h2s9Unw+2Qm5ehwFOvZCvJbyO34NDn6OzbCFBXn9ZvGI2s+3iRTzuHUPFbtmgEXcNOUft2+mypMOWvb+S4IocRA2f/M96rx2CLrij85bOWwrdkA93uf2q0uNQRXF9uJ4aJS52F6ACGvFhfObzbWqAi0S84k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770383408; c=relaxed/simple; bh=gFYsxyC9dgDjeDfBVtcYJzyaGuVUUL/UvNe3j9g5oh8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FRD3iIQLLhfCAjkjQBwVBilfR+gOhNXUtSCBJvcrkBpP9HJE5CdjWfTjbmytAC2CGUyqV59lHdljNV99jsQF+1KQmOT7czl/xi2JoWGLn3GqlqQ68R+8X1LBIv0D372n4F7XvQJIiHeL44zGIEHg/u46XfFpojAUDu3SWMa274c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com; spf=pass smtp.mailfrom=mboxify.com; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b=XztLg8BH; arc=none smtp.client-ip=136.175.108.105 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mboxify.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mboxify.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mboxify.com header.i=@mboxify.com header.b="XztLg8BH" Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta105.mxroute.com (ZoneMTA) with ESMTPSA id 19c3312d2440009140.00d for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Fri, 06 Feb 2026 13:09:57 +0000 X-Zone-Loop: a8fe2b00350307ef766c10119b4e968900b8e957a198 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mboxify.com ; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xX1GX2YlUSWR6zjeumqZ1M4CyIIwVy3o6ga5DLteJqg=; b=XztLg8BH0PMtZbWfT3Dfhtxf5L KKZk2Qb7M5CA7qaSwXo0XxmJpjjZirQiQVzpJnJsdwT/2Ql6aYpvDTOIz+zqmUSCuVRDf0CoKW2Cw IL5T6kefFpwvqvgJKdUM+q1VTsk2z/qjgqmWp0WB53UEcJgbFqrHnO/XtlU/dbetv6LvnQ4xDpwEG ViKkVm+5YnOYwb3i9qPDqyAIBSZXVJlp1Flr7h+xwj2zmb/jy1B+1tMNyL8DGoCUzi3ULc47U3te3 1VE/rxQ+rTG/zfIwe4/FWTY7BzARXESPmxX250vxZ5D0RigMVSqXA7lIgd1Y+b0+xLxEzK9TVduQy F+peWmUw==; From: Bo Sun To: kuba@kernel.org, pabeni@redhat.com Cc: gakula@marvell.com, sgoutham@marvell.com, sbhatta@marvell.com, hkelam@marvell.com, horms@kernel.org, bbhushan2@marvell.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, sumang@marvell.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bo Sun Subject: [PATCH net v2 2/2] octeontx2-af: CGX: replace kfree() with rvu_free_bitmap() Date: Fri, 6 Feb 2026 21:09:25 +0800 Message-Id: <20260206130925.1087588-3-bo@mboxify.com> In-Reply-To: <20260206130925.1087588-1-bo@mboxify.com> References: <20260206130925.1087588-1-bo@mboxify.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authenticated-Id: bo@mboxify.com Content-Type: text/plain; charset="utf-8" mac_to_index_bmap is allocated with rvu_alloc_bitmap(), so free it with rvu_free_bitmap() instead of open-coding kfree(.bmap) to keep the alloc/free API pairing consistent. Signed-off-by: Bo Sun Reviewed-by: Vadim Fedorenko --- drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/= ethernet/marvell/octeontx2/af/cgx.c index fd4792e432bf..29f5def796ba 100644 --- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c +++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c @@ -1822,7 +1822,7 @@ static int cgx_lmac_exit(struct cgx *cgx) continue; 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); + rvu_free_bitmap(&lmac->mac_to_index_bmap); rvu_free_bitmap(&lmac->rx_fc_pfvf_bmap); rvu_free_bitmap(&lmac->tx_fc_pfvf_bmap); kfree(lmac->name);