]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: octeon_ep_vf: fix free_irq dev_id mismatch in IRQ rollback
authorKery Qi <qikeyu2017@gmail.com>
Thu, 8 Jan 2026 16:42:57 +0000 (00:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 10:18:38 +0000 (11:18 +0100)
commitaa05a8371ae4a452df623f7202c72409d3c50e40
treefdcb4f6f379efc2a44ac4fd6757b51e22173d547
parentbb4fa4c0b54aae25e55faeda7f78d0c11b8cd618
net: octeon_ep_vf: fix free_irq dev_id mismatch in IRQ rollback

[ Upstream commit f93fc5d12d69012788f82151bee55fce937e1432 ]

octep_vf_request_irqs() requests MSI-X queue IRQs with dev_id set to
ioq_vector. If request_irq() fails part-way, the rollback loop calls
free_irq() with dev_id set to 'oct', which does not match the original
dev_id and may leave the irqaction registered.

This can keep IRQ handlers alive while ioq_vector is later freed during
unwind/teardown, leading to a use-after-free or crash when an interrupt
fires.

Fix the error path to free IRQs with the same ioq_vector dev_id used
during request_irq().

Fixes: 1cd3b407977c ("octeon_ep_vf: add Tx/Rx processing and interrupt support")
Signed-off-by: Kery Qi <qikeyu2017@gmail.com>
Link: https://patch.msgid.link/20260108164256.1749-2-qikeyu2017@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c