Skip to content

Commit b706db5

Browse files
aloktiwagregkh
authored andcommitted
net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
[ Upstream commit e81750b4e3826fedce7362dad839cb40384d60ae ] 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: f7b261b ("net: ll_temac: Make RX/TX ring sizes configurable") Signed-off-by: Alok Tiwari <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 3808d28 commit b706db5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/xilinx/ll_temac_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ ll_temac_ethtools_set_ringparam(struct net_device *ndev,
13111311
if (ering->rx_pending > RX_BD_NUM_MAX ||
13121312
ering->rx_mini_pending ||
13131313
ering->rx_jumbo_pending ||
1314-
ering->rx_pending > TX_BD_NUM_MAX)
1314+
ering->tx_pending > TX_BD_NUM_MAX)
13151315
return -EINVAL;
13161316

13171317
if (netif_running(ndev))

0 commit comments

Comments
 (0)