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/atlx/atl2.c | |
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/atlx/atl2.c')
-rw-r--r-- | drivers/net/atlx/atl2.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c index 10c06b97001f..ab688862093f 100644 --- a/drivers/net/atlx/atl2.c +++ b/drivers/net/atlx/atl2.c | |||
@@ -966,8 +966,6 @@ static int atl2_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
966 | data->phy_id = 0; | 966 | data->phy_id = 0; |
967 | break; | 967 | break; |
968 | case SIOCGMIIREG: | 968 | case SIOCGMIIREG: |
969 | if (!capable(CAP_NET_ADMIN)) | ||
970 | return -EPERM; | ||
971 | spin_lock_irqsave(&adapter->stats_lock, flags); | 969 | spin_lock_irqsave(&adapter->stats_lock, flags); |
972 | if (atl2_read_phy_reg(&adapter->hw, | 970 | if (atl2_read_phy_reg(&adapter->hw, |
973 | data->reg_num & 0x1F, &data->val_out)) { | 971 | data->reg_num & 0x1F, &data->val_out)) { |
@@ -977,8 +975,6 @@ static int atl2_mii_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) | |||
977 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | 975 | spin_unlock_irqrestore(&adapter->stats_lock, flags); |
978 | break; | 976 | break; |
979 | case SIOCSMIIREG: | 977 | case SIOCSMIIREG: |
980 | if (!capable(CAP_NET_ADMIN)) | ||
981 | return -EPERM; | ||
982 | if (data->reg_num & ~(0x1F)) | 978 | if (data->reg_num & ~(0x1F)) |
983 | return -EFAULT; | 979 | return -EFAULT; |
984 | spin_lock_irqsave(&adapter->stats_lock, flags); | 980 | spin_lock_irqsave(&adapter->stats_lock, flags); |