]> git.baikalelectronics.ru Git - kernel.git/commitdiff
irqdomain: Drop bogus fwspec-mapping error handling
authorJohan Hovold <johan+linaro@kernel.org>
Mon, 13 Feb 2023 10:42:45 +0000 (11:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:44:03 +0000 (16:44 +0100)
commit e3b7ab025e931accdc2c12acf9b75c6197f1c062 upstream.

In case a newly allocated IRQ ever ends up not having any associated
struct irq_data it would not even be possible to dispose the mapping.

Replace the bogus disposal with a WARN_ON().

This will also be used to fix a shared-interrupt mapping race, hence the
CC-stable tag.

Fixes: ec17aeffc43c ("irqdomain: Don't set type when mapping an IRQ")
Cc: stable@vger.kernel.org # 4.8
Tested-by: Hsin-Yi Wang <hsinyi@chromium.org>
Tested-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230213104302.17307-4-johan+linaro@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/irq/irqdomain.c

index b4e3e15e05ad896447d00f1776c52dd21ee10d26..3d1b570a1daddfad5e446637b9c35f8d9e667654 100644 (file)
@@ -851,13 +851,8 @@ unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
        }
 
        irq_data = irq_get_irq_data(virq);
-       if (!irq_data) {
-               if (irq_domain_is_hierarchy(domain))
-                       irq_domain_free_irqs(virq, 1);
-               else
-                       irq_dispose_mapping(virq);
+       if (WARN_ON(!irq_data))
                return 0;
-       }
 
        /* Store trigger type */
        irqd_set_trigger_type(irq_data, type);