]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
octeontx2-pf: fix SQB pointer leak on init failure
authorDawei Feng <dawei.feng@seu.edu.cn>
Tue, 30 Jun 2026 07:16:25 +0000 (15:16 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Fri, 3 Jul 2026 06:35:25 +0000 (08:35 +0200)
commit62e7df6d042aeebd5efb581074e28865c04477be
treedc20537c43f0b0357ce6a22e67a27581f4f70f52
parent03f384bc0cb8d4a1301d4f5b0baef2d980258383
octeontx2-pf: fix SQB pointer leak on init failure

otx2_init_hw_resources() initializes SQ aura and pool resources before
several later setup steps. On failure, err_free_sq_ptrs only frees SQB
pages, leaving the per-SQ sqb_ptrs arrays behind.

Use otx2_free_sq_res() for the SQ unwind path and let it free sqb_ptrs
even when sq->sqe has not been allocated yet.

The bug was first flagged by an experimental analysis tool we are
developing for kernel memory-management bugs while analyzing
v6.13-rc1. The tool is still under development and is not yet publicly
available. Manual inspection confirms that the bug is still
present in v7.1.1.

An x86_64 allyesconfig build showed no new warnings. As we do not have an
OcteonTX2 PF device and the corresponding AF mailbox setup to test with,
no runtime testing was able to be performed.

Fixes: caa2da34fd25 ("octeontx2-pf: Initialize and config queues")
Cc: stable@vger.kernel.org
Reviewed-by: Ratheesh Kannoth <rkannoth@marvell.com>
Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
Link: https://patch.msgid.link/20260630071625.349996-1-dawei.feng@seu.edu.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c