Polling setup creates the common IRQ resources before starting its
worker. If worker creation fails, probe skips the IRQ cleanup path.
Release the common IRQ resources before returning the worker error.
This issue was found by our static analysis tool under development.
Fixes: 294d711ee8c0 ("net: dsa: mv88e6xxx: Poll when no interrupt defined")
Signed-off-by: Guangshuo Li <ligu…@mail.sdu.edu.cn>
---
drivers/net/dsa/mv88e6xxx/chip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index a4a8c7e11bf4..8e3785ae590c 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -397,8 +397,10 @@ static int mv88e6xxx_irq_poll_setup(struct mv88e6xxx_chip *chip)
mv88e6xxx_irq_poll);
chip->kworker = kthread_run_worker(0, "%s", dev_name(chip->dev));
- if (IS_ERR(chip->kworker))
+ if (IS_ERR(chip->kworker)) {
+ mv88e6xxx_g1_irq_free_common(chip);
return PTR_ERR(chip->kworker);
+ }
kthread_queue_delayed_work(chip->kworker, &chip->irq_poll_work,
msecs_to_jiffies(100));
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
[PATCH net] net: dsa: mv88e6xxx: Fix potential IRQ domain leak in polling setup
- From
- ligu…@mail.sdu.edu.cn (Guangshuo Li)
- Organization
- Usenet Network
- Message-ID
- <2026…@mail.sdu.edu.cn>
- Date
- Newsgroups
- linux.kernel.netdev