Skip to contentSkip to conversation

smsc75xx: fix smsc75xx_set_features()

PATCH Applied Eric Dumazet 2 participants 2 messages Feb 21, 2018 – Feb 22, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smsc75xx: fix smsc75xx_set_features()

From: Eric Dumazet <[email protected]>

If an attempt is made to disable RX checksums, USB adapter is changed but netdev->features is not, because smsc75xx_set_features() returns a non zero value.

This throws errors from netdev_rx_csum_fault() :
<devname>: hw csum failure

Cc Steve Glendinning <[email protected]>

---
 drivers/net/usb/smsc75xx.c |    7 ++++---

 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/usb/smsc75xx.c +4 -3
index d0a113743195acae86931c51eea50b94ddadd487..7a6a1fe793090b8e28f5ef075f5ebc2ad385b5eb 100644
@@ -954,10 +954,11 @@ static int smsc75xx_set_features(struct net_device *netdev,
 	/* it's racing here! */
 
 	ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
-	if (ret < 0)
+	if (ret < 0) {
 		netdev_warn(dev->net, "Error writing RFE_CTL\n");
-
-	return ret;
+		return ret;
+	}
+	return 0;
 }
 
 static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
maintainer Applied
#1 lore raw

From: Eric Dumazet <[email protected]>
Date: Tue, 20 Feb 2018 21:42:26 -0800

Quoted 11 lines

From: Eric Dumazet <[email protected]>

If an attempt is made to disable RX checksums, USB adapter is changed but netdev->features is not, because smsc75xx_set_features() returns a non zero value.

This throws errors from netdev_rx_csum_fault() :
<devname>: hw csum failure

Cc Steve Glendinning <[email protected]>

Applied, thanks Eric.