aboutsummaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorYang Li <yang.lee@linux.alibaba.com>2022-07-28 11:10:19 +0800
committerJakub Kicinski <kuba@kernel.org>2022-07-28 21:50:39 -0700
commit8fd1e151779285b211e7184e9237bba69bd74386 (patch)
tree7d9da4d803b3c178fe28eed2ba51603efbc3d181 /net/tls
parent37e26188345b454aaffe05d651ada0dd7f470234 (diff)
downloadlinux-8fd1e151779285b211e7184e9237bba69bd74386.tar.gz
tls: rx: Fix unsigned comparison with less than zero
The return from the call to tls_rx_msg_size() is int, it can be a negative error code, however this is being assigned to an unsigned long variable 'sz', so making 'sz' an int. Eliminate the following coccicheck warning: ./net/tls/tls_strp.c:211:6-8: WARNING: Unsigned expression compared with zero: sz < 0 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Link: https://lore.kernel.org/r/20220728031019.32838-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_strp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c
index 3f1ec42a59233..f0b7c9122fbae 100644
--- a/net/tls/tls_strp.c
+++ b/net/tls/tls_strp.c
@@ -187,9 +187,10 @@ static int tls_strp_copyin(read_descriptor_t *desc, struct sk_buff *in_skb,
unsigned int offset, size_t in_len)
{
struct tls_strparser *strp = (struct tls_strparser *)desc->arg.data;
- size_t sz, len, chunk;
struct sk_buff *skb;
skb_frag_t *frag;
+ size_t len, chunk;
+ int sz;
if (strp->msg_ready)
return 0;