Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp151632imn; Wed, 27 Jul 2022 18:21:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJWzrbBeV8EPF+vE459fFjBKEao7jO+sJrb0iheFVT6YJf/Ynzdnsa0+dYnORh4YZYGkqF X-Received: by 2002:a05:6402:3551:b0:43c:375f:6d1 with SMTP id f17-20020a056402355100b0043c375f06d1mr13088509edd.166.1658971276767; Wed, 27 Jul 2022 18:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658971276; cv=none; d=google.com; s=arc-20160816; b=PRM656Jfn8Bi8OTn0AD/m2yZHbnc4bPDb6UyxrZnKHODgqxtLLlQdquBCpgu0v0w4N /KYfSousofefyoprZGMsQE3YSkEU0VogvPW6iu7xO2nQkVqpXl5Ozry6YWfVqgVhJPE9 V8VBex1m+D9LfiN+WCig5TOGwy0+/hQNBXJgK7I/j2c2NwCxKekE82RXOB5u8Pzii/55 XY7uWEEnhRUw48b4czY7KccalN0AqsrVGEFKEci8vHrbW0Wz44Zx2e/l5SRCrT7zt9iX cUUcSJX3ddxxSSbb82B+bBRBac315xuBOZx8yQENcdfgPxbgTr8IE9iRTeYXUk5ug7on 4F/Q== 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=PPCzj8o+25tuI6UKPtzAtWAeoCyyFx0wa0NqIkO0zfE=; b=NlnRWrPYk1t0rPewvCVTRSs5S5aucE6pkpCn3bF/qAKlhz3c2DOuBmnGjnr7ngd7QU EwxiKeEQun3J8WR20qUNWmUSQCpstEobG8gnaCWf7Epk0K8gepiAhy+zruL6Ma+tR2lE m9A4kDWlzt3LyiZ6B/9tq3f9CRBXglnfWqR94B+MWdqPjGGMcfPkg8zYeK0Qpion5plO s8obvxqNMiTbQV8socaB61PRE/88oPHTvPa+HU0Nv/POMA5mxb6I9O907nU2+sIYoOp7 69FX7s0rAiO5ul4aaMD8yA2DnNI9573jT2pauJIuwGuX/oVxgo6F/Aj55t4LXtdaHb/f ZB7A== 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 sh34-20020a1709076ea200b0072b88a810c7si7043538ejc.493.2022.07.27.18.20.51; Wed, 27 Jul 2022 18:21:16 -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 S232322AbiG1BKi (ORCPT + 99 others); Wed, 27 Jul 2022 21:10:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbiG1BKf (ORCPT ); Wed, 27 Jul 2022 21:10:35 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ACFC11168; Wed, 27 Jul 2022 18:10:32 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---0VKd5t0Z_1658970629; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VKd5t0Z_1658970629) by smtp.aliyun-inc.com; Thu, 28 Jul 2022 09:10:29 +0800 From: Yang Li To: borisp@nvidia.com Cc: john.fastabend@gmail.com, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li , Abaci Robot Subject: [PATCH -next] tls: rx: Fix unsigned comparison with less than zero Date: Thu, 28 Jul 2022 09:10:25 +0800 Message-Id: <20220728011025.10865-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,RCVD_IN_MSPIKE_H2, 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 --- 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..193e328294be 100644 --- a/net/tls/tls_strp.c +++ b/net/tls/tls_strp.c @@ -187,7 +187,8 @@ 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; + int sz; + size_t len, chunk; struct sk_buff *skb; skb_frag_t *frag; -- 2.20.1.7.g153144c