net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Thu, 10 Jul 2025 18:06:17 +0000 (11:06 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 11 Jul 2025 14:27:26 +0000 (07:27 -0700)
The function ll_temac_ethtools_set_ringparam() incorrectly checked
rx_pending twice, once correctly for RX and once mistakenly in place
of tx_pending. This caused tx_pending to be left unchecked against
TX_BD_NUM_MAX.
As a result, invalid TX ring sizes may have been accepted or valid
ones wrongly rejected based on the RX limit, leading to potential
misconfiguration or unexpected results.

This patch corrects the condition to properly validate tx_pending.

Fixes: f7b261bfc35e ("net: ll_temac: Make RX/TX ring sizes configurable")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20250710180621.2383000-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/xilinx/ll_temac_main.c

index edb36ff07a0c6feba383d85a6c0ef074c0450256..6f82203a414cd8ee5542fb402d3ce257b8ff623a 100644 (file)
@@ -1309,7 +1309,7 @@ ll_temac_ethtools_set_ringparam(struct net_device *ndev,
        if (ering->rx_pending > RX_BD_NUM_MAX ||
            ering->rx_mini_pending ||
            ering->rx_jumbo_pending ||
-           ering->rx_pending > TX_BD_NUM_MAX)
+           ering->tx_pending > TX_BD_NUM_MAX)
                return -EINVAL;
 
        if (netif_running(ndev))