Original fix b8b277525e9d was done under impression that invalid data
could be written for mtu configuration higher that 16334.

But the high limit will anyway be rejected my max_mtu check in caller.
Thus, make the code cleaner and allow it doing the configuration without
checking for maximum mtu value.

Fixes: b8b277525e9d ("aqc111: fix endianness issue in aqc111_change_mtu")
Signed-off-by: Igor Russkikh <igor.russk...@aquantia.com>
---
 drivers/net/usb/aqc111.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
index 408df2d335e3..7e44110746dd 100644
--- a/drivers/net/usb/aqc111.c
+++ b/drivers/net/usb/aqc111.c
@@ -437,7 +437,7 @@ static int aqc111_change_mtu(struct net_device *net, int 
new_mtu)
        aqc111_write16_cmd(dev, AQ_ACCESS_MAC, SFR_MEDIUM_STATUS_MODE,
                           2, &reg16);
 
-       if (dev->net->mtu > 12500 && dev->net->mtu <= 16334) {
+       if (dev->net->mtu > 12500) {
                memcpy(buf, &AQC111_BULKIN_SIZE[2], 5);
                /* RX bulk configuration */
                aqc111_write_cmd(dev, AQ_ACCESS_MAC, SFR_RX_BULKIN_QCTRL,
@@ -451,10 +451,8 @@ static int aqc111_change_mtu(struct net_device *net, int 
new_mtu)
                reg16 = 0x1020;
        else if (dev->net->mtu <= 12500)
                reg16 = 0x1420;
-       else if (dev->net->mtu <= 16334)
-               reg16 = 0x1A20;
        else
-               return 0;
+               reg16 = 0x1A20;
 
        aqc111_write16_cmd(dev, AQ_ACCESS_MAC, SFR_PAUSE_WATERLVL_LOW,
                           2, &reg16);
-- 
2.17.1

Reply via email to