From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: [PATCH net-stable 23/24] hv_netvsc: Fix net device attach on older Windows hosts Date: Mon, 14 May 2018 15:32:22 -0700 Message-ID: <20180514223223.25433-24-sthemmin@microsoft.com> References: <20180514223223.25433-1-sthemmin@microsoft.com> Cc: netdev@vger.kernel.org, Mohammed Gamal To: davem@davemloft.net Return-path: Received: from mail-pf0-f195.google.com ([209.85.192.195]:43272 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbeENWdD (ORCPT ); Mon, 14 May 2018 18:33:03 -0400 Received: by mail-pf0-f195.google.com with SMTP id j20-v6so6678964pff.10 for ; Mon, 14 May 2018 15:33:03 -0700 (PDT) In-Reply-To: <20180514223223.25433-1-sthemmin@microsoft.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Mohammed Gamal 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 Reviewed-by: Stephen Hemminger Signed-off-by: David S. Miller --- drivers/net/hyperv/rndis_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 3bfa56560286..6dde92c1c113 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -1276,7 +1276,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, rndis_device->link_state ? "down" : "up"); if (net_device->nvsp_version < NVSP_PROTOCOL_VERSION_5) - return net_device; + goto out; rndis_filter_query_link_speed(rndis_device, net_device); -- 2.17.0