diff options
| author | Marc Zyngier <maz@kernel.org> | 2023-05-30 11:01:22 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-21 15:59:14 +0200 |
| commit | 27825a6da78bf7b2345fe5d3579d76a5b3e7cb07 (patch) | |
| tree | 8b592e83e8b860d7b7356ba6cf4e1a6870beb51a /drivers/irqchip | |
| parent | f50018e2dd87573176a9bbe28b9e8ead392321af (diff) | |
| download | linux-27825a6da78bf7b2345fe5d3579d76a5b3e7cb07.tar.gz linux-27825a6da78bf7b2345fe5d3579d76a5b3e7cb07.tar.bz2 linux-27825a6da78bf7b2345fe5d3579d76a5b3e7cb07.zip | |
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>
Diffstat (limited to 'drivers/irqchip')
| -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 de47b51cdadb..afd6a1841715 100644 --- a/drivers/irqchip/irq-gic-common.c +++ b/drivers/irqchip/irq-gic-common.c @@ -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; |
