Skip to content

Commit e81750b

Browse files
aloktiwakuba-moo
authored andcommitted
net: ll_temac: Fix missing tx_pending check in ethtools_set_ringparam()
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]>
1 parent 5b81d59 commit e81750b

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
@@ -1309,7 +1309,7 @@ ll_temac_ethtools_set_ringparam(struct net_device *ndev,
13091309
if (ering->rx_pending > RX_BD_NUM_MAX ||
13101310
ering->rx_mini_pending ||
13111311
ering->rx_jumbo_pending ||
1312-
ering->rx_pending > TX_BD_NUM_MAX)
1312+
ering->tx_pending > TX_BD_NUM_MAX)
13131313
return -EINVAL;
13141314

13151315
if (netif_running(ndev))

0 commit comments

Comments
 (0)