diff options
author | Patrick McHardy <kaber@trash.net> | 2009-04-17 18:59:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-17 18:59:23 -0400 |
commit | 7816a0a862d851d0b05710e7d94bfe390f3180e2 (patch) | |
tree | 0b4f9099df21b1f7295637e8c28aa72721150b7d /net/8021q | |
parent | 75a241f959a65ec9bde237d1af1a34ef794f0c9c (diff) |
vlan/macvlan: fix NULL pointer dereferences in ethtool handlers
Check whether the underlying device provides a set of ethtool ops before
checking for individual handlers to avoid NULL pointer dereferences.
Reported-by: Art van Breemen <ard@telegraafnet.nl>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q')
-rw-r--r-- | net/8021q/vlan_dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |