Skip to contentSkip to conversation

ax25: non working tests on unsigned ax25_ctl.arg

PATCH Roel Kluin 1 participant 1 message Apr 21, 2009 Networking

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

vi include/linux/ax25.h +77
and note that ax25_ctl.arg is unsigned, should there maybe be a test

if (ax25_ctl.arg > MAX)

	return -EINVAL;

(and what should MAX be then?)

Otherwise you may want to apply the cleanup patch below

Roel ------------------------------>8-------------8<--------------------------------- Remove redundant tests on unsigned

---

net/ax25/af_ax25.c +0 -4
index fd9d06f..9964df3 100644
@@ -418,14 +418,10 @@ static int ax25_ctl_ioctl(const unsigned int cmd, void __user *arg)
 		break;
 
 	case AX25_T3:
-		if (ax25_ctl.arg < 0)
-			return -EINVAL;
 		ax25->t3 = ax25_ctl.arg * HZ;
 		break;
 
 	case AX25_IDLE:
-		if (ax25_ctl.arg < 0)
-			return -EINVAL;
 		ax25->idle = ax25_ctl.arg * 60 * HZ;
 		break;