aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-03-13 19:04:12 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-13 19:04:12 -0400
commit8db09f26f912f7c90c764806e804b558da520d4f (patch)
treea02b562f75c862306aebbfa207bcdb1657a87bd9 /net
parent73ce7b01b4496a5fbf9caf63033c874be692333f (diff)
x25: '< 0' and '>= 0' test on unsigned
skb->len is an unsigned int, so the test in x25_rx_call_request() always evaluates to true. len in x25_sendmsg() is unsigned as well. so -ERRORS returned by x25_output() are not noticed. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/x25/af_x25.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 1000e9a26fdb..9ca17b1ce52e 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -951,10 +951,8 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
951 /* 951 /*
952 * Incoming Call User Data. 952 * Incoming Call User Data.
953 */ 953 */
954 if (skb->len >= 0) { 954 skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len);
955 skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len); 955 makex25->calluserdata.cudlength = skb->len;
956 makex25->calluserdata.cudlength = skb->len;
957 }
958 956
959 sk->sk_ack_backlog++; 957 sk->sk_ack_backlog++;
960 958
@@ -1122,8 +1120,9 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock,
1122 if (msg->msg_flags & MSG_OOB) 1120 if (msg->msg_flags & MSG_OOB)
1123 skb_queue_tail(&x25->interrupt_out_queue, skb); 1121 skb_queue_tail(&x25->interrupt_out_queue, skb);
1124 else { 1122 else {
1125 len = x25_output(sk, skb); 1123 rc = x25_output(sk, skb);
1126 if (len < 0) 1124 len = rc;
1125 if (rc < 0)
1127 kfree_skb(skb); 1126 kfree_skb(skb);
1128 else if (x25->qbitincl) 1127 else if (x25->qbitincl)
1129 len++; 1128 len++;