[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ca3335ea-b9cd-4158-91a3-758cba9df804@lunn.ch>
Date: Tue, 23 Dec 2025 10:43:27 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Yeounsu Moon <yyyynoom@...il.com>
Cc: Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net] net: dlink: mask rx_coalesce/rx_timeout before
writing RxDMAIntCtrl
On Tue, Dec 23, 2025 at 09:10:06AM +0900, Yeounsu Moon wrote:
> RxDMAIntCtrl encodes rx_coalesce in the low 16 bits
> and rx_timeout in the high 16 bits. If either value exceeds
> the field width, the current code may truncate the value and/or
> corrupt adjacent bits when programming the register.
>
> Mask both values to 16 bits and cast to u32 before shifting
> so only the intended fields are written.
It would be better to do range checks in rio_probe1() and call
netdev_err() and return -EINVAL?
Anybody trying to use very large values then gets an error message
rather than it working, but not as expected.
Andrew
Powered by blists - more mailing lists