Skip to contentSkip to conversation

octeontx2-pf: Fix leak of SQ timestamp buffer on teardown

PATCH Applied Ratheesh Kannoth 3 participants 3 messages Jun 15 – Jun 18

Subsystems (3)
lore
Share & tools
lore

Ratheesh Kannoth

author maintainer
#0 lore raw

PATCH 1/1 octeontx2-pf: Fix leak of SQ timestamp buffer on teardown

The send-queue timestamp ring is allocated with qmem_alloc() when timestamping is used, but otx2_free_sq_res() never freed sq->timestamps, leaking that memory across ifdown and device removal. Add the missing qmem_free() alongside the other SQ companion buffers.

Fixes c9c12d339d93 ("octeontx2-pf: Add support for PTP clock")
Cc Aleksey Makarov <[email protected]>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 -0
index f9fbf0c17648..0c2da974ac6d 100644
@@ -1578,6 +1578,7 @@ static void otx2_free_sq_res(struct otx2_nic *pf)
 		qmem_free(pf->dev, sq->sqe_ring);
 		qmem_free(pf->dev, sq->cpt_resp);
 		qmem_free(pf->dev, sq->tso_hdrs);
+		qmem_free(pf->dev, sq->timestamps);
 		kfree(sq->sg);
 		kfree(sq->sqb_ptrs);
 	}
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ratheesh Kannoth

The send-queue timestamp ring is allocated with qmem_alloc() when timestamping is used, but otx2_free_sq_res() never freed sq->timestamps, leaking that memory across ifdown and device removal. Add the missing qmem_free() alongside the other SQ companion buffers.

Fixes c9c12d339d93 ("octeontx2-pf: Add support for PTP clock")
Cc Aleksey Makarov <[email protected]>
#2 lore raw
In reply to Ratheesh Kannoth
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Mon, 15 Jun 2026 08:37:04 +0530 you wrote:

The send-queue timestamp ring is allocated with qmem_alloc() when timestamping is used, but otx2_free_sq_res() never freed sq->timestamps, leaking that memory across ifdown and device removal. Add the missing qmem_free() alongside the other SQ companion buffers.

Fixes c9c12d339d93 ("octeontx2-pf: Add support for PTP clock")
Cc Aleksey Makarov <[email protected]>

[...]

Here is the summary with links:
- [net] octeontx2-pf: Fix leak of SQ timestamp buffer on teardown

    https://git.kernel.org/netdev/net/c/a056db30de92

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html