aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
-rw-r--r--drivers/net/hyperv/netvsc_drv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 507f68190cb1..1121a1ec407c 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -29,6 +29,7 @@
29#include <linux/netdevice.h> 29#include <linux/netdevice.h>
30#include <linux/inetdevice.h> 30#include <linux/inetdevice.h>
31#include <linux/etherdevice.h> 31#include <linux/etherdevice.h>
32#include <linux/pci.h>
32#include <linux/skbuff.h> 33#include <linux/skbuff.h>
33#include <linux/if_vlan.h> 34#include <linux/if_vlan.h>
34#include <linux/in.h> 35#include <linux/in.h>
@@ -2039,12 +2040,16 @@ static int netvsc_register_vf(struct net_device *vf_netdev)
2039{ 2040{
2040 struct net_device *ndev; 2041 struct net_device *ndev;
2041 struct net_device_context *net_device_ctx; 2042 struct net_device_context *net_device_ctx;
2043 struct device *pdev = vf_netdev->dev.parent;
2042 struct netvsc_device *netvsc_dev; 2044 struct netvsc_device *netvsc_dev;
2043 int ret; 2045 int ret;
2044 2046
2045 if (vf_netdev->addr_len != ETH_ALEN) 2047 if (vf_netdev->addr_len != ETH_ALEN)
2046 return NOTIFY_DONE; 2048 return NOTIFY_DONE;
2047 2049
2050 if (!pdev || !dev_is_pci(pdev) || dev_is_pf(pdev))
2051 return NOTIFY_DONE;
2052
2048 /* 2053 /*
2049 * We will use the MAC address to locate the synthetic interface to 2054 * We will use the MAC address to locate the synthetic interface to
2050 * associate with the VF interface. If we don't find a matching 2055 * associate with the VF interface. If we don't find a matching