diff options
author | Oliver Neukum <oneukum@suse.com> | 2019-05-09 05:08:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-05-09 12:35:40 -0400 |
commit | 2cf672709beb005f6e90cb4edbed6f2218ba953e (patch) | |
tree | 374981415b60d03859a6c8e8b3af81a203ce42be /drivers/net/usb | |
parent | 369b46e9fbcfa5136f2cb5f486c90e5f7fa92630 (diff) |
aqc111: fix double endianness swap on BE
If you are using a function that does a swap in place,
you cannot just reuse the buffer on the assumption that it has
not been changed.
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.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c index 599d560a8450..b86c5ce9a92a 100644 --- a/drivers/net/usb/aqc111.c +++ b/drivers/net/usb/aqc111.c | |||
@@ -1428,7 +1428,7 @@ static int aqc111_resume(struct usb_interface *intf) | |||
1428 | { | 1428 | { |
1429 | struct usbnet *dev = usb_get_intfdata(intf); | 1429 | struct usbnet *dev = usb_get_intfdata(intf); |
1430 | struct aqc111_data *aqc111_data = dev->driver_priv; | 1430 | struct aqc111_data *aqc111_data = dev->driver_priv; |
1431 | u16 reg16; | 1431 | u16 reg16, oldreg16; |
1432 | u8 reg8; | 1432 | u8 reg8; |
1433 | 1433 | ||
1434 | netif_carrier_off(dev->net); | 1434 | netif_carrier_off(dev->net); |
@@ -1444,9 +1444,11 @@ static int aqc111_resume(struct usb_interface *intf) | |||
1444 | /* Configure RX control register => start operation */ | 1444 | /* Configure RX control register => start operation */ |
1445 | reg16 = aqc111_data->rxctl; | 1445 | reg16 = aqc111_data->rxctl; |
1446 | reg16 &= ~SFR_RX_CTL_START; | 1446 | reg16 &= ~SFR_RX_CTL_START; |
1447 | /* needs to be saved in case endianness is swapped */ | ||
1448 | oldreg16 = reg16; | ||
1447 | aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, ®16); | 1449 | aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, ®16); |
1448 | 1450 | ||
1449 | reg16 |= SFR_RX_CTL_START; | 1451 | reg16 = oldreg16 | SFR_RX_CTL_START; |
1450 | aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, ®16); | 1452 | aqc111_write16_cmd_nopm(dev, AQ_ACCESS_MAC, SFR_RX_CTL, 2, ®16); |
1451 | 1453 | ||
1452 | aqc111_set_phy_speed(dev, aqc111_data->autoneg, | 1454 | aqc111_set_phy_speed(dev, aqc111_data->autoneg, |