diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-09-03 06:39:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-03 23:02:11 -0400 |
commit | 7ab0f2736bfe137a82a7084bbfb5f809da95cabd (patch) | |
tree | e305ec96eceebb285efee4b6fd307822ab257fe6 /drivers/net/e1000 | |
parent | aae5e7c30fc660c50dfecbdd745799b05af90f01 (diff) |
netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementations
dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the
driver's implementation of MDIO ioctls.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000')
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 2c723b1b8820..c66dd4f9437c 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -4714,8 +4714,6 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, | |||
4714 | data->phy_id = hw->phy_addr; | 4714 | data->phy_id = hw->phy_addr; |
4715 | break; | 4715 | break; |
4716 | case SIOCGMIIREG: | 4716 | case SIOCGMIIREG: |
4717 | if (!capable(CAP_NET_ADMIN)) | ||
4718 | return -EPERM; | ||
4719 | spin_lock_irqsave(&adapter->stats_lock, flags); | 4717 | spin_lock_irqsave(&adapter->stats_lock, flags); |
4720 | if (e1000_read_phy_reg(hw, data->reg_num & 0x1F, | 4718 | if (e1000_read_phy_reg(hw, data->reg_num & 0x1F, |
4721 | &data->val_out)) { | 4719 | &data->val_out)) { |
@@ -4725,8 +4723,6 @@ static int e1000_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, | |||
4725 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | 4723 | spin_unlock_irqrestore(&adapter->stats_lock, flags); |
4726 | break; | 4724 | break; |
4727 | case SIOCSMIIREG: | 4725 | case SIOCSMIIREG: |
4728 | if (!capable(CAP_NET_ADMIN)) | ||
4729 | return -EPERM; | ||
4730 | if (data->reg_num & ~(0x1F)) | 4726 | if (data->reg_num & ~(0x1F)) |
4731 | return -EFAULT; | 4727 | return -EFAULT; |
4732 | mii_reg = data->val_in; | 4728 | mii_reg = data->val_in; |