]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
irqchip/gic: Correctly validate OF quirk descriptors
authorMarc Zyngier <maz@kernel.org>
Tue, 30 May 2023 10:01:22 +0000 (11:01 +0100)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:05 +0000 (17:19 +0200)
BugLink: https://bugs.launchpad.net/bugs/2033931
[ Upstream commit 91539341a3b6e9c868024a4292455dae36e6f58c ]

When checking for OF quirks, make sure either 'compatible' or 'property'
is set, and give up otherwise.

This avoids non-OF quirks being randomly applied as they don't have any
of the OF data that need checking.

Cc: Douglas Anderson <dianders@chromium.org>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: 44bd78dd2b88 ("irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/irqchip/irq-gic-common.c

index de47b51cdadbe120210bdce4e717154168b0f117..afd6a1841715a152afd572dac15e4366bfd96d1f 100644 (file)
@@ -16,6 +16,8 @@ void gic_enable_of_quirks(const struct device_node *np,
                          const struct gic_quirk *quirks, void *data)
 {
        for (; quirks->desc; quirks++) {
+               if (!quirks->compatible && !quirks->property)
+                       continue;
                if (quirks->compatible &&
                    !of_device_is_compatible(np, quirks->compatible))
                        continue;