Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2017-10-20 12:20:33 +0200
committerOlaf Hering <ohering@suse.de>2017-10-20 12:23:27 +0200
commit1ab71d889dbd4b2009cb74cd2907fdf8e9c35116 (patch)
tree4fb50c7caec4cc643301910af04aa08d03903ff9
parent501d2f90fc64219461f5549ca4dcce42d6016745 (diff)
netvsc: check error return when restoring channels and mtu
-rw-r--r--patches.suse/msft-hv-1428-netvsc-check-error-return-when-restoring-channels-an.patch54
-rw-r--r--series.conf1
2 files changed, 55 insertions, 0 deletions
diff --git a/patches.suse/msft-hv-1428-netvsc-check-error-return-when-restoring-channels-an.patch b/patches.suse/msft-hv-1428-netvsc-check-error-return-when-restoring-channels-an.patch
new file mode 100644
index 0000000000..c04374d62f
--- /dev/null
+++ b/patches.suse/msft-hv-1428-netvsc-check-error-return-when-restoring-channels-an.patch
@@ -0,0 +1,54 @@
+From: stephen hemminger <stephen@networkplumber.org>
+Date: Wed, 9 Aug 2017 17:46:06 -0700
+Patch-mainline: v4.14-rc1
+Subject: netvsc: check error return when restoring channels and mtu
+Git-commit: 68d715f68541d58033199eea80991394a6886eb7
+References: fate#323887
+
+If setting new values fails, and the attempt to restore original
+settings fails. Then log an error and leave device down.
+This should never happen, but if it does don't go down in flames.
+
+Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Acked-by: Olaf Hering <ohering@suse.de>
+---
+ drivers/net/hyperv/netvsc_drv.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
+--- a/drivers/net/hyperv/netvsc_drv.c
++++ b/drivers/net/hyperv/netvsc_drv.c
+@@ -845,7 +845,13 @@ static int netvsc_set_channels(struct net_device *net,
+ } else {
+ ret = PTR_ERR(nvdev);
+ device_info.num_chn = orig;
+- rndis_filter_device_add(dev, &device_info);
++ nvdev = rndis_filter_device_add(dev, &device_info);
++
++ if (IS_ERR(nvdev)) {
++ netdev_err(net, "restoring channel setting failed: %ld\n",
++ PTR_ERR(nvdev));
++ return ret;
++ }
+ }
+
+ if (was_opened)
+@@ -953,10 +959,16 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu)
+
+ /* Attempt rollback to original MTU */
+ ndev->mtu = orig_mtu;
+- rndis_filter_device_add(hdev, &device_info);
++ nvdev = rndis_filter_device_add(hdev, &device_info);
+
+ if (vf_netdev)
+ dev_set_mtu(vf_netdev, orig_mtu);
++
++ if (IS_ERR(nvdev)) {
++ netdev_err(ndev, "restoring mtu failed: %ld\n",
++ PTR_ERR(nvdev));
++ return ret;
++ }
+ }
+
+ if (was_opened)
diff --git a/series.conf b/series.conf
index 69292ebc37..4dc6f88b58 100644
--- a/series.conf
+++ b/series.conf
@@ -1678,6 +1678,7 @@
patches.suse/msft-hv-1425-netvsc-delay-setup-of-VF-device.patch
patches.suse/msft-hv-1426-netvsc-don-t-signal-host-twice-if-empty.patch
patches.suse/msft-hv-1427-netvsc-propagate-MAC-address-change-to-VF-slave.patch
+ patches.suse/msft-hv-1428-netvsc-check-error-return-when-restoring-channels-an.patch
patches.suse/suse-hv-guest-os-id.patch
patches.suse/suse-hv-kvp_on_msg.dbg.patch