aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2008-04-25 03:11:31 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-25 03:11:31 -0400
commitf946dffed6334f08da065a89ed65026ebf8b33b4 (patch)
tree64751c19f951f9c5e4df443337a1194e24481155
parentd4f73c8e459d355e10051174d859ffd0ef5764c0 (diff)
[netdrvr] tehuti: move ioctl perm check closer to function start
Noticed by davem. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/net/tehuti.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index d2e1b219673d..e83b166aa6b9 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -649,6 +649,9 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
649 DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); 649 DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
650 } 650 }
651 651
652 if (!capable(CAP_NET_ADMIN))
653 return -EPERM;
654
652 switch (data[0]) { 655 switch (data[0]) {
653 656
654 case BDX_OP_READ: 657 case BDX_OP_READ:
@@ -664,8 +667,6 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
664 break; 667 break;
665 668
666 case BDX_OP_WRITE: 669 case BDX_OP_WRITE:
667 if (!capable(CAP_NET_ADMIN))
668 return -EPERM;
669 error = bdx_range_check(priv, data[1]); 670 error = bdx_range_check(priv, data[1]);
670 if (error < 0) 671 if (error < 0)
671 return error; 672 return error;