summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2019-05-09 05:08:16 -0400
committerDavid S. Miller <davem@davemloft.net>2019-05-09 12:35:40 -0400
commitb8b277525e9df2fd2dc3d1f4fe01c6796bb107fc (patch)
treed4c2af4b3e7545a1b0d5092264daf41fbdd9245c /drivers/net/usb
parent873017af778439f2f8e3d87f28ddb1fcaf244a76 (diff)
aqc111: fix endianness issue in aqc111_change_mtu
If the MTU is large enough, the first write to the device is just repeated. On BE architectures, however, the first word of the command will be swapped a second time and garbage will be written. Avoid that. Signed-off-by: Oliver Neukum <oneukum@suse.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/aqc111.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
index aff995be2a31..408df2d335e3 100644
--- a/drivers/net/usb/aqc111.c
+++ b/drivers/net/usb/aqc111.c
@@ -453,6 +453,8 @@ static int aqc111_change_mtu(struct net_device *net, int new_mtu)
453 reg16 = 0x1420; 453 reg16 = 0x1420;
454 else if (dev->net->mtu <= 16334) 454 else if (dev->net->mtu <= 16334)
455 reg16 = 0x1A20; 455 reg16 = 0x1A20;
456 else
457 return 0;
456 458
457 aqc111_write16_cmd(dev, AQ_ACCESS_MAC, SFR_PAUSE_WATERLVL_LOW, 459 aqc111_write16_cmd(dev, AQ_ACCESS_MAC, SFR_PAUSE_WATERLVL_LOW,
458 2, &reg16); 460 2, &reg16);