summaryrefslogtreecommitdiffstats
path: root/net/ax25/af_ax25.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-10-18 11:06:56 +0200
committerDavid S. Miller <davem@davemloft.net>2013-10-18 19:56:07 +0200
commit768877537de6b9f7c043b73f82baab4f09ee9799 (patch)
tree3928a6454b32cbaf5389de8a66007356ad9142a1 /net/ax25/af_ax25.c
parentfib_trie: remove duplicated rcu lock (diff)
downloadlinux-768877537de6b9f7c043b73f82baab4f09ee9799.tar.xz
linux-768877537de6b9f7c043b73f82baab4f09ee9799.zip
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>
Diffstat (limited to 'net/ax25/af_ax25.c')
-rw-r--r--net/ax25/af_ax25.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
index 4b4d2b779ec1..a00123ebb0ae 100644
--- a/net/ax25/af_ax25.c
+++ b/net/ax25/af_ax25.c
@@ -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;
}