]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
octeontx2-pf: Fix leak of SQ timestamp buffer on teardown
authorRatheesh Kannoth <rkannoth@marvell.com>
Mon, 15 Jun 2026 03:07:04 +0000 (08:37 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 17 Jun 2026 23:25:30 +0000 (16:25 -0700)
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 <amakarov@marvell.com>
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260615030704.504536-1-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

index 41a0ebdf201e7116cdb6cee87bbd2672ecd3cda0..b63df5737ff2316abd289f6fc1d4471144857550 100644 (file)
@@ -1575,6 +1575,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);
        }