Patch "net: ti: icssg-prueth: Fix signedness bug in prueth_init_rx_chns()" has been added to the 6.6-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

    net: ti: icssg-prueth: Fix signedness bug in prueth_init_rx_chns()

to the 6.6-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:
     net-ti-icssg-prueth-fix-signedness-bug-in-prueth_ini.patch
and it can be found in the queue-6.6 subdirectory.

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



commit b14375ce1c4ba32ed38a2b83127298eb0cf88d93
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Tue Apr 23 19:15:22 2024 +0300

    net: ti: icssg-prueth: Fix signedness bug in prueth_init_rx_chns()
    
    [ Upstream commit 4dcd0e83ea1d1df9b2e0174a6d3e795b3477d64e ]
    
    The rx_chn->irq[] array is unsigned int but it should be signed for the
    error handling to work.  Also if k3_udma_glue_rx_get_irq() returns zero
    then we should return -ENXIO instead of success.
    
    Fixes: 128d5874c082 ("net: ti: icssg-prueth: Add ICSSG ethernet driver")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Reviewed-by: Roger Quadros <rogerq@xxxxxxxxxx>
    Reviewed-by: MD Danish Anwar <danishanwar@xxxxxx>
    Link: https://lore.kernel.org/r/05282415-e7f4-42f3-99f8-32fde8f30936@moroto.mountain
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index c09ecb3da7723..925044c16c6ae 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -421,12 +421,14 @@ static int prueth_init_rx_chns(struct prueth_emac *emac,
 		if (!i)
 			fdqring_id = k3_udma_glue_rx_flow_get_fdq_id(rx_chn->rx_chn,
 								     i);
-		rx_chn->irq[i] = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i);
-		if (rx_chn->irq[i] <= 0) {
-			ret = rx_chn->irq[i];
+		ret = k3_udma_glue_rx_get_irq(rx_chn->rx_chn, i);
+		if (ret <= 0) {
+			if (!ret)
+				ret = -ENXIO;
 			netdev_err(ndev, "Failed to get rx dma irq");
 			goto fail;
 		}
+		rx_chn->irq[i] = ret;
 	}
 
 	return 0;




[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