Skip to content

Commit 610533c

Browse files
committed
Merge tag 'irq-urgent-2026-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fixes from Ingo Molnar: "Misc irqchip driver fixes: - Fix a resource leak in the RISC-V imsic-early driver (Haoxiang Li) - Fix an OF node reference leak in the ARM gic-v3-its driver (Yuho Choi) - Fix a dangling handler function on module removal bug in the TS-4800 ARM board irqchip driver (Qingshuang Fu)" * tag 'irq-urgent-2026-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/ts4800: Fix missing chained handler cleanup on remove irqchip/gic-v3-its: Fix OF node reference leak irqchip/irq-riscv-imsic-early: Fix fwnode leak on state setup failure
2 parents 216a8b2 + 98bf7e5 commit 610533c

3 files changed

Lines changed: 20 additions & 11 deletions

File tree

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,11 +3290,9 @@ static void its_cpu_init_collection(struct its_node *its)
32903290

32913291
/* avoid cross node collections and its mapping */
32923292
if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) {
3293-
struct device_node *cpu_node;
3293+
struct device_node *cpu_node __free(device_node) = of_get_cpu_node(cpu, NULL);
32943294

3295-
cpu_node = of_get_cpu_node(cpu, NULL);
3296-
if (its->numa_node != NUMA_NO_NODE &&
3297-
its->numa_node != of_node_to_nid(cpu_node))
3295+
if (its->numa_node != NUMA_NO_NODE && its->numa_node != of_node_to_nid(cpu_node))
32983296
return;
32993297
}
33003298

drivers/irqchip/irq-riscv-imsic-early.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -272,16 +272,13 @@ static int __init imsic_early_acpi_init(union acpi_subtable_headers *header,
272272
rc = imsic_setup_state(imsic_acpi_fwnode, imsic);
273273
if (rc) {
274274
pr_err("%pfwP: failed to setup state (error %d)\n", imsic_acpi_fwnode, rc);
275-
return rc;
275+
goto cleanup;
276276
}
277277

278278
/* Do early setup of IMSIC state and IPIs */
279279
rc = imsic_early_probe(imsic_acpi_fwnode);
280-
if (rc) {
281-
irq_domain_free_fwnode(imsic_acpi_fwnode);
282-
imsic_acpi_fwnode = NULL;
283-
return rc;
284-
}
280+
if (rc)
281+
goto cleanup;
285282

286283
rc = imsic_platform_acpi_probe(imsic_acpi_fwnode);
287284

@@ -300,8 +297,12 @@ static int __init imsic_early_acpi_init(union acpi_subtable_headers *header,
300297
* DT where IPI works but MSI probe fails for some reason.
301298
*/
302299
return 0;
303-
}
304300

301+
cleanup:
302+
irq_domain_free_fwnode(imsic_acpi_fwnode);
303+
imsic_acpi_fwnode = NULL;
304+
return rc;
305+
}
305306
IRQCHIP_ACPI_DECLARE(riscv_imsic, ACPI_MADT_TYPE_IMSIC, NULL,
306307
1, imsic_early_acpi_init);
307308
#endif

drivers/irqchip/irq-ts4800.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct ts4800_irq_data {
2828
void __iomem *base;
2929
struct platform_device *pdev;
3030
struct irq_domain *domain;
31+
unsigned int parent_irq;
3132
};
3233

3334
static void ts4800_irq_mask(struct irq_data *d)
@@ -134,6 +135,7 @@ static int ts4800_ic_probe(struct platform_device *pdev)
134135
irq_set_chained_handler_and_data(parent_irq,
135136
ts4800_ic_chained_handle_irq, data);
136137

138+
data->parent_irq = parent_irq;
137139
platform_set_drvdata(pdev, data);
138140

139141
return 0;
@@ -142,6 +144,14 @@ static int ts4800_ic_probe(struct platform_device *pdev)
142144
static void ts4800_ic_remove(struct platform_device *pdev)
143145
{
144146
struct ts4800_irq_data *data = platform_get_drvdata(pdev);
147+
unsigned int hwirq;
148+
149+
irq_set_chained_handler_and_data(data->parent_irq, NULL, NULL);
150+
151+
for (hwirq = 0; hwirq < 8; hwirq++)
152+
irq_dispose_mapping(irq_find_mapping(data->domain, hwirq));
153+
154+
irq_dispose_mapping(data->parent_irq);
145155

146156
irq_domain_remove(data->domain);
147157
}

0 commit comments

Comments
 (0)