Patchwork drivers/net/skfp: if !capable(CAP_NET_ADMIN): inverted logic

login
register
mail settings
Submitter roel kluin
Date Jan. 28, 2009, 7:25 p.m.
Message ID <4980B135.8040209@gmail.com>
Download mbox | patch
Permalink /patch/20661/
State Accepted
Delegated to: David Miller
Headers show

Comments

roel kluin - Jan. 28, 2009, 7:25 p.m.
untested, but It seems this is likely what it should be.
--------------------->8---------8<----------------
fix inverted logic

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Jan. 30, 2009, 1:32 a.m.
From: Roel Kluin <roel.kluin@gmail.com>
Date: Wed, 28 Jan 2009 20:25:41 +0100

> untested, but It seems this is likely what it should be.
> --------------------->8---------8<----------------
> fix inverted logic
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Good catch Roel, patch applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/skfp/skfddi.c b/drivers/net/skfp/skfddi.c
index 607efea..9a00e55 100644
--- a/drivers/net/skfp/skfddi.c
+++ b/drivers/net/skfp/skfddi.c
@@ -1003,9 +1003,9 @@  static int skfp_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 		break;
 	case SKFP_CLR_STATS:	/* Zero out the driver statistics */
 		if (!capable(CAP_NET_ADMIN)) {
-			memset(&lp->MacStat, 0, sizeof(lp->MacStat));
-		} else {
 			status = -EPERM;
+		} else {
+			memset(&lp->MacStat, 0, sizeof(lp->MacStat));
 		}
 		break;
 	default: