diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-08-14 19:10:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-22 07:43:43 +0200 |
commit | 6f560142350cf340a90be6b2e0007373424ead4c (patch) | |
tree | 8313e7115c4cbf95223a9d1c8c3fe8a035c5c36d | |
parent | cd0fb1cb23a8057d7a004dfbcdcb739cc30c04fe (diff) | |
download | linux-6f560142350cf340a90be6b2e0007373424ead4c.tar.gz |
hv/netvsc: Fix NULL dereference at single queue mode fallback
[ Upstream commit b19b46346f483ae055fa027cb2d5c2ca91484b91 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/hyperv/rndis_filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 408ece27131c4..2a5209f23f296 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -1338,7 +1338,7 @@ out: /* setting up multiple channels failed */ net_device->max_chn = 1; net_device->num_chn = 1; - return 0; + return net_device; err_dev_remv: rndis_filter_device_remove(dev, net_device); |