diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-10-23 01:21:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-29 04:39:53 -0400 |
commit | 091bb8ab51c668635d1a75359019005921676881 (patch) | |
tree | 6cecf1abd03209db800880cb090e24cdf58146e4 /net/x25 | |
parent | 50e4fe91a5edbf680853b2ca37300a47ff860d63 (diff) |
net: Cleanup redundant tests on unsigned
If there is data, the unsigned skb->len is greater than 0.
rt.sigdigits is unsigned as well, so the test `>= 0' is
always true, the other part of the test catches wrapped
values.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/x25')
-rw-r--r-- | net/x25/x25_in.c | 2 | ||||
-rw-r--r-- | net/x25/x25_route.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/net/x25/x25_in.c b/net/x25/x25_in.c index 7d7c3abf38b5..96d922783547 100644 --- a/net/x25/x25_in.c +++ b/net/x25/x25_in.c | |||
@@ -114,7 +114,7 @@ static int x25_state1_machine(struct sock *sk, struct sk_buff *skb, int frametyp | |||
114 | /* | 114 | /* |
115 | * Copy any Call User Data. | 115 | * Copy any Call User Data. |
116 | */ | 116 | */ |
117 | if (skb->len >= 0) { | 117 | if (skb->len > 0) { |
118 | skb_copy_from_linear_data(skb, | 118 | skb_copy_from_linear_data(skb, |
119 | x25->calluserdata.cuddata, | 119 | x25->calluserdata.cuddata, |
120 | skb->len); | 120 | skb->len); |
diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c index 2c999ccf504a..66961ea28c91 100644 --- a/net/x25/x25_route.c +++ b/net/x25/x25_route.c | |||
@@ -190,7 +190,7 @@ int x25_route_ioctl(unsigned int cmd, void __user *arg) | |||
190 | goto out; | 190 | goto out; |
191 | 191 | ||
192 | rc = -EINVAL; | 192 | rc = -EINVAL; |
193 | if (rt.sigdigits < 0 || rt.sigdigits > 15) | 193 | if (rt.sigdigits > 15) |
194 | goto out; | 194 | goto out; |
195 | 195 | ||
196 | dev = x25_dev_get(rt.device); | 196 | dev = x25_dev_get(rt.device); |