Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp749382rwb; Thu, 8 Dec 2022 02:25:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf5DIT+eIWozpODtfM20M6Tx7axWGXLnwsN5jp1r32VxEiF/zjV5W50FewcArP7KKi1/GuHA X-Received: by 2002:aa7:cc8a:0:b0:464:1296:d5d4 with SMTP id p10-20020aa7cc8a000000b004641296d5d4mr81110033edt.83.1670495102767; Thu, 08 Dec 2022 02:25:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670495102; cv=none; d=google.com; s=arc-20160816; b=n0BUhYG49Lo6wp+K+myteIfF2b8Vcich7WiCl0YgE56Mg4X8rxYFTKOah176T1yl02 S+ApAHYiZBT8YVlUaLIbWUZpfMbqepx5Ju19qxyF2N8X1RHInkBa90E/jqEn/dXoYHc/ gvMWiCKGza8d3Oza887qCgh53Lc2VFI59M5aUSl5f4eNeywMLMdxqrRGFp+/Te2CEpoI RIjIuMfvdvOT71mQE2MzyWTBuM3GFPr8WdvGt67ZN54kckT63fCuPUGk8uPqafAv6X7g qp2Z1pryKcHE3NghnQgKcC7jNDWUDjZlXWM2BqrAmOMfsgSF29QgStLu+vg0TZDwwpMi vdag== 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=4ojpoopnwBwCN0jtTdWE3aPRWrYNtue0gSmUFNMZcbk=; b=rfAnaXTsPCoQ5A7XX0/Y//QkC/esHm9UpCry3Mk/T9VqDq4WcWJIXYC1ezUT1RSLaC zshHIX3O3GvZZPsZw/5fdPPttav2Nu8jgCGtojQGXmQYztIG4kXGQsewc/yasKbUC5wn VOFJmwmsenxG2ocCGv55uVZ2WSkXn5BlS0FkRK710Snt9jkPtLZLUVayXk3WfdegQ0/n /U+ldQQXoe3lttePNYDeUUuhtTDlLM/shVoYX9P7xXnvv97BonL1Iy2r9ubWOQqPvsPZ CHgTwjvHUe1deuzPgsA/g1b8RekimoUeXBbEaFg7Ynqw6c6gMpoeZ2Jeg0EU03wwrkNO ozSA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b12-20020a056402350c00b0046400f454a3si7112934edd.125.2022.12.08.02.24.44; Thu, 08 Dec 2022 02:25:02 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbiLHKG2 (ORCPT + 72 others); Thu, 8 Dec 2022 05:06:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbiLHKG1 (ORCPT ); Thu, 8 Dec 2022 05:06:27 -0500 Received: from cstnet.cn (smtp23.cstnet.cn [159.226.251.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 80548537C9; Thu, 8 Dec 2022 02:06:25 -0800 (PST) Received: from localhost.localdomain (unknown [124.16.138.125]) by APP-03 (Coremail) with SMTP id rQCowADnJswMt5Fj7Eh1BQ--.11268S2; Thu, 08 Dec 2022 18:06:04 +0800 (CST) From: Jiasheng Jiang To: leon@kernel.org Cc: jiri@resnulli.us, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: Re: [PATCH net v2] ice: Add check for kzalloc Date: Thu, 8 Dec 2022 18:06:03 +0800 Message-Id: <20221208100603.29588-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: rQCowADnJswMt5Fj7Eh1BQ--.11268S2 X-Coremail-Antispam: 1UD129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYf7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E 6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28Cjx kF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8I cVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2js IEc7CjxVAFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE 5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeV CFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1l FIxGxcIEc7CjxVA2Y2ka0xkIwI1lc2xSY4AK67AK6r4DMxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUb8hL5UUUUU== X-Originating-IP: [124.16.138.125] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 On Thu, Dec 08, 2022 at 05:25:02PM +0800, Leon Romanovsky wrote: >> +err_out: >> + for (j = 0; j < i; j++) { > > You don't need an extra variable, "while(i--)" will do the trick. No, the right range is [0, i - 1], but the "while(i--)" is [1, i]. If using "while(i--)", the code should be "tty_port_destroy(pf->gnss_tty_port[i - 1]);". It will be more complex. Therefore, it is worthwhile to use an extra varaible. Thanks, Jiang