diff options
| author | Radim Krčmář <rkrcmar@redhat.com> | 2018-09-07 18:30:47 +0200 |
|---|---|---|
| committer | Radim Krčmář <rkrcmar@redhat.com> | 2018-09-07 18:30:47 +0200 |
| commit | ed2ef29100644eabc6099cbf1a3aa9d938555ab8 (patch) | |
| tree | dadd3eb5d77ae2c44adc92869c662292bd652f46 /drivers/net/hyperv/netvsc_drv.c | |
| parent | 732b53146ac8f604e45c593efe0579f78205fdcc (diff) | |
| parent | df88f3181f10565c6e3a89eb6f0f9e6afaaf15f1 (diff) | |
Merge tag 'kvm-s390-master-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux
KVM: s390: Fixes for 4.19
- Fallout from the hugetlbfs support: pfmf interpretion and locking
- VSIE: fix keywrapping for nested guests
Diffstat (limited to 'drivers/net/hyperv/netvsc_drv.c')
| -rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 5 |
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 @@ #include <linux/netdevice.h> #include <linux/inetdevice.h> #include <linux/etherdevice.h> +#include <linux/pci.h> #include <linux/skbuff.h> #include <linux/if_vlan.h> #include <linux/in.h> @@ -2039,12 +2040,16 @@ static int netvsc_register_vf(struct net_device *vf_netdev) { struct net_device *ndev; struct net_device_context *net_device_ctx; + struct device *pdev = vf_netdev->dev.parent; struct netvsc_device *netvsc_dev; int ret; if (vf_netdev->addr_len != ETH_ALEN) return NOTIFY_DONE; + if (!pdev || !dev_is_pci(pdev) || dev_is_pf(pdev)) + return NOTIFY_DONE; + /* * We will use the MAC address to locate the synthetic interface to * associate with the VF interface. If we don't find a matching |
