Patch "i2c: emev2: add IRQ check" 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

    i2c: emev2: add IRQ check

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:
     i2c-emev2-add-irq-check.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 986dea18c531a2319aad9d03fcea492dee6e307f
Author: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
Date:   Sat Apr 10 23:16:41 2021 +0300

    i2c: emev2: add IRQ check
    
    [ Upstream commit bb6129c32867baa7988f7fd2066cf18ed662d240 ]
    
    The driver neglects to check the result of platform_get_irq()'s call and
    blithely passes the negative error codes to devm_request_irq() (which
    takes *unsigned* IRQ #), causing it to fail with -EINVAL, overriding
    an original error code.  Stop calling devm_request_irq() with invalid
    IRQ #s.
    
    Fixes: 5faf6e1f58b4 ("i2c: emev2: add driver")
    Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
    Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c
index a08554c1a570..bdff0e6345d9 100644
--- a/drivers/i2c/busses/i2c-emev2.c
+++ b/drivers/i2c/busses/i2c-emev2.c
@@ -395,7 +395,10 @@ static int em_i2c_probe(struct platform_device *pdev)
 
 	em_i2c_reset(&priv->adap);
 
-	priv->irq = platform_get_irq(pdev, 0);
+	ret = platform_get_irq(pdev, 0);
+	if (ret < 0)
+		goto err_clk;
+	priv->irq = ret;
 	ret = devm_request_irq(&pdev->dev, priv->irq, em_i2c_irq_handler, 0,
 				"em_i2c", priv);
 	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