diff options
| -rw-r--r-- | drivers/crypto/chelsio/chtls/chtls_io.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c index 8cfc27b4337d..51fc6821cbbf 100644 --- a/drivers/crypto/chelsio/chtls/chtls_io.c +++ b/drivers/crypto/chelsio/chtls/chtls_io.c | |||
| @@ -907,11 +907,11 @@ static int chtls_skb_copy_to_page_nocache(struct sock *sk, | |||
| 907 | } | 907 | } |
| 908 | 908 | ||
| 909 | /* Read TLS header to find content type and data length */ | 909 | /* Read TLS header to find content type and data length */ |
| 910 | static u16 tls_header_read(struct tls_hdr *thdr, struct iov_iter *from) | 910 | static int tls_header_read(struct tls_hdr *thdr, struct iov_iter *from) |
| 911 | { | 911 | { |
| 912 | if (copy_from_iter(thdr, sizeof(*thdr), from) != sizeof(*thdr)) | 912 | if (copy_from_iter(thdr, sizeof(*thdr), from) != sizeof(*thdr)) |
| 913 | return -EFAULT; | 913 | return -EFAULT; |
| 914 | return (__force u16)cpu_to_be16(thdr->length); | 914 | return (__force int)cpu_to_be16(thdr->length); |
| 915 | } | 915 | } |
| 916 | 916 | ||
| 917 | static int csk_mem_free(struct chtls_dev *cdev, struct sock *sk) | 917 | static int csk_mem_free(struct chtls_dev *cdev, struct sock *sk) |
| @@ -1083,9 +1083,10 @@ new_buf: | |||
| 1083 | int off = TCP_OFF(sk); | 1083 | int off = TCP_OFF(sk); |
| 1084 | bool merge; | 1084 | bool merge; |
| 1085 | 1085 | ||
| 1086 | if (page) | 1086 | if (!page) |
| 1087 | pg_size <<= compound_order(page); | 1087 | goto wait_for_memory; |
| 1088 | 1088 | ||
| 1089 | pg_size <<= compound_order(page); | ||
| 1089 | if (off < pg_size && | 1090 | if (off < pg_size && |
| 1090 | skb_can_coalesce(skb, i, page, off)) { | 1091 | skb_can_coalesce(skb, i, page, off)) { |
| 1091 | merge = 1; | 1092 | merge = 1; |
| @@ -1492,7 +1493,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, | |||
| 1492 | break; | 1493 | break; |
| 1493 | chtls_cleanup_rbuf(sk, copied); | 1494 | chtls_cleanup_rbuf(sk, copied); |
| 1494 | sk_wait_data(sk, &timeo, NULL); | 1495 | sk_wait_data(sk, &timeo, NULL); |
| 1495 | continue; | 1496 | continue; |
| 1496 | found_ok_skb: | 1497 | found_ok_skb: |
| 1497 | if (!skb->len) { | 1498 | if (!skb->len) { |
| 1498 | skb_dst_set(skb, NULL); | 1499 | skb_dst_set(skb, NULL); |
