hv_netvsc: Fix error handling in netvsc_set_features()
authorHaiyang Zhang <haiyangz@microsoft.com>
Wed, 30 Oct 2019 15:32:11 +0000 (15:32 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 31 Oct 2019 01:17:36 +0000 (18:17 -0700)
When an error is returned by rndis_filter_set_offload_params(), we should
still assign the unaffected features to ndev->features. Otherwise, these
features will be missing.

Fixes: d6792a5a0747 ("hv_netvsc: Add handler for LRO setting change")
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/netvsc_drv.c

index fd4fff57fd6e25cfebcc46069fda8fb823ba0757..bab7c1f84dfd62b13aa3d32e54fd656918de6bd1 100644 (file)
@@ -1807,8 +1807,10 @@ static int netvsc_set_features(struct net_device *ndev,
 
        ret = rndis_filter_set_offload_params(ndev, nvdev, &offloads);
 
-       if (ret)
+       if (ret) {
                features ^= NETIF_F_LRO;
+               ndev->features = features;
+       }
 
 syncvf:
        if (!vf_netdev)