mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 09:25:22 +02:00
spi: ppc4xx: handle irq_of_parse_and_map() errors
[ Upstream commit0f245463b0
] Zero and negative number is not a valid IRQ for in-kernel code and the irq_of_parse_and_map() function returns zero on error. So this check for valid IRQs should only accept values > 0. Fixes:44dab88e7c
("spi: add spi_ppc4xx driver") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Link: https://patch.msgid.link/20240724084047.1506084-1-make24@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
80f5bfbb80
commit
1b08f7b5f5
|
@ -411,6 +411,9 @@ static int spi_ppc4xx_of_probe(struct platform_device *op)
|
|||
|
||||
/* Request IRQ */
|
||||
hw->irqnum = irq_of_parse_and_map(np, 0);
|
||||
if (hw->irqnum <= 0)
|
||||
goto free_host;
|
||||
|
||||
ret = request_irq(hw->irqnum, spi_ppc4xx_int,
|
||||
0, "spi_ppc4xx_of", (void *)hw);
|
||||
if (ret) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user