aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-14 13:10:50 -0400
committerDavid S. Miller <davem@davemloft.net>2018-08-14 13:24:12 -0400
commitb19b46346f483ae055fa027cb2d5c2ca91484b91 (patch)
treeb26dffe551e19bc43255104bf6b8e4b74a9a97a8
parent4597b62f7a60d912a2bd00ca574e6bc7b87be905 (diff)
hv/netvsc: Fix NULL dereference at single queue mode fallback
The recent commit 916c5e1413be ("hv/netvsc: fix handling of fallback to single queue mode") tried to fix the fallback behavior to a single queue mode, but it changed the function to return zero incorrectly, while the function should return an object pointer. Eventually this leads to a NULL dereference at the callers that expect non-NULL value. Fix it by returning the proper net_device object. Fixes: 916c5e1413be ("hv/netvsc: fix handling of fallback to single queue mode") Signed-off-by: Takashi Iwai <tiwai@suse.de> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/hyperv/rndis_filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 408ece27131c..2a5209f23f29 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1338,7 +1338,7 @@ out:
1338 /* setting up multiple channels failed */ 1338 /* setting up multiple channels failed */
1339 net_device->max_chn = 1; 1339 net_device->max_chn = 1;
1340 net_device->num_chn = 1; 1340 net_device->num_chn = 1;
1341 return 0; 1341 return net_device;
1342 1342
1343err_dev_remv: 1343err_dev_remv:
1344 rndis_filter_device_remove(dev, net_device); 1344 rndis_filter_device_remove(dev, net_device);