Skip to contentSkip to conversation

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

PATCH In review Roel Kluin 2 participants 2 messages Jan 28, 2009 – Jan 30, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

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

untested, but It seems this is likely what it should be. --------------------->8---------8<---------------- fix inverted logic

---

drivers/net/skfp/skfddi.c +2 -2
index 607efea..9a00e55 100644
@@ -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:
maintainer
#1 lore raw

From: Roel Kluin <[email protected]>
Date: Wed, 28 Jan 2009 20:25:41 +0100

Quoted 5 lines

untested, but It seems this is likely what it should be. --------------------->8---------8<---------------- fix inverted logic

Good catch Roel, patch applied.