diff options
author | Marc Zyngier <maz@kernel.org> | 2023-05-30 13:01:22 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-21 16:45:37 +0300 |
commit | 93a68acc497bf59d523761ae40f348ded413c744 (patch) | |
tree | 7f74ebfadea26b8f9398201700161cfc4b35ac4b | |
parent | 2a2641a842eac11abd906eafa90e76b20afe32e8 (diff) | |
download | linux-93a68acc497bf59d523761ae40f348ded413c744.tar.xz |
irqchip/gic: Correctly validate OF quirk descriptors
[ 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>
-rw-r--r-- | drivers/irqchip/irq-gic-common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/irqchip/irq-gic-common.c b/drivers/irqchip/irq-gic-common.c index 02828a16979a..b8a10f2e72da 100644 --- a/drivers/irqchip/irq-gic-common.c +++ b/drivers/irqchip/irq-gic-common.c @@ -29,6 +29,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; |