Commit 8db09f26 authored by Roel Kluin's avatar Roel Kluin Committed by David S. Miller

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: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73ce7b01
...@@ -951,10 +951,8 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb, ...@@ -951,10 +951,8 @@ int x25_rx_call_request(struct sk_buff *skb, struct x25_neigh *nb,
/* /*
* Incoming Call User Data. * Incoming Call User Data.
*/ */
if (skb->len >= 0) { skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len);
skb_copy_from_linear_data(skb, makex25->calluserdata.cuddata, skb->len); makex25->calluserdata.cudlength = skb->len;
makex25->calluserdata.cudlength = skb->len;
}
sk->sk_ack_backlog++; sk->sk_ack_backlog++;
...@@ -1122,8 +1120,9 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1122,8 +1120,9 @@ static int x25_sendmsg(struct kiocb *iocb, struct socket *sock,
if (msg->msg_flags & MSG_OOB) if (msg->msg_flags & MSG_OOB)
skb_queue_tail(&x25->interrupt_out_queue, skb); skb_queue_tail(&x25->interrupt_out_queue, skb);
else { else {
len = x25_output(sk, skb); rc = x25_output(sk, skb);
if (len < 0) len = rc;
if (rc < 0)
kfree_skb(skb); kfree_skb(skb);
else if (x25->qbitincl) else if (x25->qbitincl)
len++; len++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment