aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/macvlan.c9
-rw-r--r--net/8021q/vlan_dev.c3
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 70d3ef4a2c5f..214a8cf2b708 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -376,7 +376,8 @@ static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev)
376 const struct macvlan_dev *vlan = netdev_priv(dev); 376 const struct macvlan_dev *vlan = netdev_priv(dev);
377 struct net_device *lowerdev = vlan->lowerdev; 377 struct net_device *lowerdev = vlan->lowerdev;
378 378
379 if (lowerdev->ethtool_ops->get_rx_csum == NULL) 379 if (lowerdev->ethtool_ops == NULL ||
380 lowerdev->ethtool_ops->get_rx_csum == NULL)
380 return 0; 381 return 0;
381 return lowerdev->ethtool_ops->get_rx_csum(lowerdev); 382 return lowerdev->ethtool_ops->get_rx_csum(lowerdev);
382} 383}
@@ -387,7 +388,8 @@ static int macvlan_ethtool_get_settings(struct net_device *dev,
387 const struct macvlan_dev *vlan = netdev_priv(dev); 388 const struct macvlan_dev *vlan = netdev_priv(dev);
388 struct net_device *lowerdev = vlan->lowerdev; 389 struct net_device *lowerdev = vlan->lowerdev;
389 390
390 if (!lowerdev->ethtool_ops->get_settings) 391 if (!lowerdev->ethtool_ops ||
392 !lowerdev->ethtool_ops->get_settings)
391 return -EOPNOTSUPP; 393 return -EOPNOTSUPP;
392 394
393 return lowerdev->ethtool_ops->get_settings(lowerdev, cmd); 395 return lowerdev->ethtool_ops->get_settings(lowerdev, cmd);
@@ -398,7 +400,8 @@ static u32 macvlan_ethtool_get_flags(struct net_device *dev)
398 const struct macvlan_dev *vlan = netdev_priv(dev); 400 const struct macvlan_dev *vlan = netdev_priv(dev);
399 struct net_device *lowerdev = vlan->lowerdev; 401 struct net_device *lowerdev = vlan->lowerdev;
400 402
401 if (!lowerdev->ethtool_ops->get_flags) 403 if (!lowerdev->ethtool_ops ||
404 !lowerdev->ethtool_ops->get_flags)
402 return 0; 405 return 0;
403 return lowerdev->ethtool_ops->get_flags(lowerdev); 406 return lowerdev->ethtool_ops->get_flags(lowerdev);
404} 407}
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 1b34135cf990..6b0921364014 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -668,7 +668,8 @@ static int vlan_ethtool_get_settings(struct net_device *dev,
668 const struct vlan_dev_info *vlan = vlan_dev_info(dev); 668 const struct vlan_dev_info *vlan = vlan_dev_info(dev);
669 struct net_device *real_dev = vlan->real_dev; 669 struct net_device *real_dev = vlan->real_dev;
670 670
671 if (!real_dev->ethtool_ops->get_settings) 671 if (!real_dev->ethtool_ops ||
672 !real_dev->ethtool_ops->get_settings)
672 return -EOPNOTSUPP; 673 return -EOPNOTSUPP;
673 674
674 return real_dev->ethtool_ops->get_settings(real_dev, cmd); 675 return real_dev->ethtool_ops->get_settings(real_dev, cmd);