Thread (2 messages) flat view 2 messages, 2 authors, 3d ago
WARM3d

[PATCH net] octeontx2-af: Fix BPID leak in nix_bp_enable()

From: <hidden>
Date: 2026-09-01 10:25:21
Also in: lkml
Subsystem: marvell octeontx2 rvu admin function driver, networking drivers, the rest · Maintainers: Sunil Goutham, Ratheesh Kannoth, Geetha sowjanya, Subbaraya Sundeep, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

From: Rakesh Kudurumalla <redacted>

Avoid calling rvu_nix_get_bpid() after the last channel is programmed.
For LBK interfaces, each call allocates a BPID, so the extra final call
can leak one BPID.

Fixes: 27150bc4286c ("octeontx2-af: Interface backpressure configuration")
Signed-off-by: Nitin Shetty J <redacted>
Signed-off-by: Rakesh Kudurumalla <redacted>
---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
index b81c47ea023b..c6164da4caa6 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c
@@ -784,7 +784,8 @@ static int nix_bp_enable(struct rvu *rvu,
 		rvu_write64(rvu, blkaddr, NIX_AF_RX_CHANX_CFG(chan_v),
 			    cfg | (bpid & GENMASK_ULL(8, 0)) | BIT_ULL(16));
 		chan_id++;
-		bpid = rvu_nix_get_bpid(rvu, req, type, chan_id);
+		if (chan_id < req->chan_cnt)
+			bpid = rvu_nix_get_bpid(rvu, req, type, chan_id);
 	}
 
 	for (chan = 0; chan < req->chan_cnt; chan++) {
-- 
2.48.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help