]> git.baikalelectronics.ru Git - kernel.git/commit
r8169: improve rtl_coalesce_choose_scale
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 30 Apr 2020 19:57:32 +0000 (21:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 May 2020 00:39:15 +0000 (17:39 -0700)
commit70b0540ff2f5a2bc422fc9ba3ac5b7b3f7c4b291
treea5db59a394f987769ff8e0caee3d3904cfa10dbd
parent313aff5d25b95a1fa9112e016b2412503706fccc
r8169: improve rtl_coalesce_choose_scale

The time limit provided by userspace is multiplied with 1000,
what could result in an overflow. Therefore change the time limit
parameter unit from ns to us, and avoid the problematic operation.
If there's no matching scale because provided time limit is too big,
return ERANGE instead of EINVAL to provide a hint to the user what's
wrong.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169_main.c