Patch "sata_mv: add IRQ checks" has been added to the 5.10-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

    sata_mv: add IRQ checks

to the 5.10-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:
     sata_mv-add-irq-checks.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 0eadb026853dd76857010d23ebf92d90496d3a85
Author: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
Date:   Sun Mar 28 00:13:49 2021 +0300

    sata_mv: add IRQ checks
    
    [ Upstream commit e6471a65fdd5efbb8dd2732dd0f063f960685ceb ]
    
    The function mv_platform_probe() neglects to check the results of the
    calls to platform_get_irq() and irq_of_parse_and_map() and blithely
    passes them to ata_host_activate() -- while the latter only checks
    for IRQ0 (treating it as a polling mode indicattion) and passes the
    negative values to devm_request_irq() causing it to fail as it takes
    unsigned values for the IRQ #...
    
    Add to mv_platform_probe() the proper IRQ checks to pass the positive IRQ
    #s to ata_host_activate(), propagate upstream the negative error codes,
    and override the IRQ0 with -EINVAL (as we don't want the polling mode).
    
    Fixes: f351b2d638c3 ("sata_mv: Support SoC controllers")
    Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/51436f00-27a1-e20b-c21b-0e817e0a7c86@xxxxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 664ef658a955..b62446ea5f40 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -4097,6 +4097,10 @@ static int mv_platform_probe(struct platform_device *pdev)
 		n_ports = mv_platform_data->n_ports;
 		irq = platform_get_irq(pdev, 0);
 	}
+	if (irq < 0)
+		return irq;
+	if (!irq)
+		return -EINVAL;
 
 	host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
 	hpriv = devm_kzalloc(&pdev->dev, sizeof(*hpriv), GFP_KERNEL);



[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