Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76887753 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 77dfca7e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
		}