net: wangxun: limit tx_max_coalesced_frames_irq

Add limitation on tx_max_coalesced_frames_irq as 0 ~ 65535, because
'wx->tx_work_limit' is declared as a member of type u16.

Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250821023408.53472-3-jiawenwu@trustnetic.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jiawen Wu 2025-08-21 10:34:06 +08:00 committed by Jakub Kicinski
parent 6d3f753c9c
commit fd4aa243f1

View File

@ -334,8 +334,11 @@ int wx_set_coalesce(struct net_device *netdev,
return -EOPNOTSUPP;
}
if (ec->tx_max_coalesced_frames_irq)
wx->tx_work_limit = ec->tx_max_coalesced_frames_irq;
if (ec->tx_max_coalesced_frames_irq > U16_MAX ||
!ec->tx_max_coalesced_frames_irq)
return -EINVAL;
wx->tx_work_limit = ec->tx_max_coalesced_frames_irq;
switch (wx->mac.type) {
case wx_mac_sp: