* ax25: non working tests on unsigned ax25_ctl.arg
@ 2009-04-21 12:55 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-04-21 12:55 UTC (permalink / raw)
To: jreuter, linux-hams
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
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index fd9d06f..9964df3 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-21 12:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 12:55 ax25: non working tests on unsigned ax25_ctl.arg Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox