ax25: cleanup a range test

The current test works fine in practice.  The "amount" variable is
actually used as a boolean so negative values or any non-zero values
count as "true".  However since we don't allow numbers greater than one,
let's not allow negative numbers either.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Dan Carpenter 2013-10-18 12:06:56 +03:00 committed by David S. Miller
parent 77dfca7e45
commit 768877537d

View File

@ -1735,7 +1735,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
res = -EFAULT;
break;
}
if (amount > AX25_NOUID_BLOCK) {
if (amount < 0 || amount > AX25_NOUID_BLOCK) {
res = -EINVAL;
break;
}