Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp201090imn; Wed, 27 Jul 2022 20:19:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vvWomJJ8ybXkW2n3FizeM9xzmZ3YvxKW3mrh3U/Dpyig1HZHFXafOFEiEjiqrJvvbIK9B7 X-Received: by 2002:a62:2546:0:b0:505:b6d2:abc8 with SMTP id l67-20020a622546000000b00505b6d2abc8mr25355799pfl.11.1658978350758; Wed, 27 Jul 2022 20:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658978350; cv=none; d=google.com; s=arc-20160816; b=UdBInbZjx2fPMKA6Bqdiua9DqSRHke73LCTmI1SN2xOkiwFGPHeUWIcnO/UL2LZJOk Z8t4J2YpXecxLMs9RVRMXkQyQj938FPQUtXZaveY//xm8uSOjAJfcCuFsKNL/lv/TvMP 2Fatk6zPhqg/PsqRpvaFSB0PSO/OdDRTIqz8FGZ8TpQQJvwBg/rb+wndhUzLrG4DpIRw VXiBEURsgarxmcSVE9n3BVsCCIhAtYWz8sUSLz2aE4JrqRaZep4Lx1e4xY0rhdHr5V0C kdcodJ1m5A8sui9jtG2OdHJmhPPa2DQ9Ff2WPpt8gEYZHbUfe7eMa0XJo3bs9MPHTKrk NfkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6nnMNTaHHfYPRbia04Ru8NvteCh/xIexOnUNx5z6eWY=; b=guX7urpU3YWLPcWKKV+cELE74tz0Ev2I6/HiQuwCNfowGMKQtvMfG2P7S9DwL/LvnR rE9TDr1VJNEyI4CA7a4uqeTH63bZHL3jCxKE/LM3uzsFZQiF5PFg7mGPJrwZv7Xp5zsr jti8MuQrYnGdSaadLPPXsLwHt7FXsZTtY3TKMMfTgKfUPNZvIQXp8frgbnSwqphpSwV0 pDxkw80W4z/LV1Dxo0qELKRA6WWsxtSjOxYtjb1B9q9T/SUcies0qhNZIGIY5QYTctuW aHwtdEBM/c1QEwnUJs0tBxIyrLmwftK3YunTH2NnxYKFehNnN5hkqj/XkZMxbz5dAYoT hXJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a63d442000000b0040d114082f0si4269663pgj.41.2022.07.27.20.18.55; Wed, 27 Jul 2022 20:19:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237804AbiG1DKi (ORCPT + 99 others); Wed, 27 Jul 2022 23:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234096AbiG1DK0 (ORCPT ); Wed, 27 Jul 2022 23:10:26 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9034BC0; Wed, 27 Jul 2022 20:10:24 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VKdXSoX_1658977820; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VKdXSoX_1658977820) by smtp.aliyun-inc.com; Thu, 28 Jul 2022 11:10:21 +0800 From: Yang Li To: kuba@kernel.org Cc: borisp@nvidia.com, john.fastabend@gmail.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next v2] tls: rx: Fix unsigned comparison with less than zero Date: Thu, 28 Jul 2022 11:10:19 +0800 Message-Id: <20220728031019.32838-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Yang Li --- Changes in v2: --According to Jakub's suggestion Keep the sorting of the variable lines from longest to shortest. net/tls/tls_strp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c index b945288c312e..841e721a8ec4 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; -- 2.20.1.7.g153144c