Patch "spi: ppc4xx: handle irq_of_parse_and_map() errors" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    spi: ppc4xx: handle irq_of_parse_and_map() errors

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     spi-ppc4xx-handle-irq_of_parse_and_map-errors.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6c4e13cd2945c92bd38219a64b0e36ed8380d8fb
Author: Ma Ke <make24@xxxxxxxxxxx>
Date:   Wed Jul 24 16:40:47 2024 +0800

    spi: ppc4xx: handle irq_of_parse_and_map() errors
    
    [ Upstream commit 0f245463b01ea254ae90e1d0389e90b0e7d8dc75 ]
    
    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: 44dab88e7cc9 ("spi: add spi_ppc4xx driver")
    Signed-off-by: Ma Ke <make24@xxxxxxxxxxx>
    Link: https://patch.msgid.link/20240724084047.1506084-1-make24@xxxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
index 58765a62fc15b..8a1290fb4dd9d 100644
--- a/drivers/spi/spi-ppc4xx.c
+++ b/drivers/spi/spi-ppc4xx.c
@@ -495,6 +495,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) {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux