]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:27:59 +0000 (18:27 +0200)
commitcb124975e490c0311093a7157d3b2193cf765ab8
tree74b337eb041a713d674575dd6203faafb7aeff6f
parent4c83b70b113ca7f1d549d336cb45e88254ea511b
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: 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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/xilinx/ll_temac_main.c