hv_netvsc: Fix net device attach on older Windows hosts
authorMohammed Gamal <mgamal@redhat.com>
Mon, 14 May 2018 22:32:22 +0000 (15:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:30 +0000 (16:17 +0200)
commitc98b38c5ede478b938944109e71798462c36c88c
tree9ca00ad57a5711518a7c4ab7a061df449bd88120
parentc7da51021c8d3d09cc31396a12af75bb222dcfcf
hv_netvsc: Fix net device attach on older Windows hosts

[ Commit 55be9f25be1ca5bda75c39808fc77e42691bc07f upstream. ]

On older windows hosts the net_device instance is returned to
the caller of rndis_filter_device_add() without having the presence
bit set first. This would cause any subsequent calls to network device
operations (e.g. MTU change, channel change) to fail after the device
is detached once, returning -ENODEV.

Instead of returning the device instabce, we take the exit path where
we call netif_device_attach()

Fixes: 7b2ee50c0cd5 ("hv_netvsc: common detach logic")
Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/hyperv/rndis_filter.c