Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp832240rwb; Thu, 8 Dec 2022 03:37:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7mZIeWwD8FHnkqDUeKYaFKAMVoKxb+CVEK+2DS32rTHMA+6hzudDuyyYHSMptoFcTbaTL/ X-Received: by 2002:a17:903:41c3:b0:189:a5b9:4838 with SMTP id u3-20020a17090341c300b00189a5b94838mr40171428ple.104.1670499471744; Thu, 08 Dec 2022 03:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670499471; cv=none; d=google.com; s=arc-20160816; b=mwsOtYqthNEcKclxyQO4BPavaWUbaja2X+PvfWDnDc15Ja7hPDMVQGjylMYzNqf0sn VgHL2IC7JKo3F0xIOIMdHZr23G/dB0uUfwEJZsfBubvhx97jRvpR3aEwWF3ileAY/OLf Yrz+E8o5x60nxuoU/fFPpFwVlUzg4VTVXGL/gDMno4BCVHBBKtaH9VpWJihLDd76DTQz tmwSpV4isMRV3OfxmEJCSyyLvqOV7SgWqkAc9UtHiio9u1ARM1Ohbb8ZnzPAFVJgBars 5fl2FV6kzGKiMR5BJUGJfeMPgoVBy36SFk0CBNNUDjNRxAuunEqGwvv5UUTxI5LqyvWa 6s1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oT2rBAyYzBWLma8KMHZ+cgilhfzsGAXdOAC/OUiRkiI=; b=cj7awXSeYDByZ2aL9nQ8M38DeDVu2oHIWsCO3ftFQW005Bq+bX+8vktcOLzVLM75fA EYv7XD0LwFVYd96vLzFGSpcEj+hnFuFjqUWiuIqXOncAgv/bmkfmmlq6pQ4xKuHCQ2EE rNxLx2aWB2AtQcZYmAze7GzEDMUY+vmFAa95Hg8e1EmXHE4bLCf9GpbdU9XAbZA0aKsr z2nG3BhjqXkJa/MKqBiYf7gfXJf8QOpg7dxd84xY02izS3LbAtYw9D/bmzl2RGLKP8qL vmDyorANxitSkhGp/1UFPH/Fn12b3fGwzuPj7fuzC33D9uo5E5WO3CWzDsJNW6Da2ld2 EuPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=SJY2ShYO; 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 t26-20020a63955a000000b0047897e4ab3dsi15944658pgn.282.2022.12.08.03.37.41; Thu, 08 Dec 2022 03:37:51 -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; dkim=pass header.i=@resnulli-us.20210112.gappssmtp.com header.s=20210112 header.b=SJY2ShYO; 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 S229492AbiLHLSI (ORCPT + 72 others); Thu, 8 Dec 2022 06:18:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiLHLSG (ORCPT ); Thu, 8 Dec 2022 06:18:06 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C8CC4730A for ; Thu, 8 Dec 2022 03:18:03 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id vv4so3094707ejc.2 for ; Thu, 08 Dec 2022 03:18:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oT2rBAyYzBWLma8KMHZ+cgilhfzsGAXdOAC/OUiRkiI=; b=SJY2ShYOGTIbPhBYczDaWzlurej2dSXzGDh6/nIOVDmC0aEN/0Jwe7KSuw/Dv1iEGi WXnyLoVqbs62c+0xshTao9VbfPXzaZbWaK6BAbyq4q+x93GDLyh7/MpP37aOTaLH6o0h 4sybymi3lSIXBbGg9bcedvmRMhGx04QnoxTH07jTeCuIoUhE5wOiqxTVe3gm2lZxzrlO RD6kfSaRV67NWLeZEmI5xgspv/WOCgTCly3z8GOEyV0kGkeHUinfS9alzcfjUIjffy/X /WuauN0oMUEjT+pwYntbWKJ02dbIh/asW9qYhxhAa18YFAOYkPTn5zGHUwXqE6f17mge M3xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oT2rBAyYzBWLma8KMHZ+cgilhfzsGAXdOAC/OUiRkiI=; b=j8Ku24a0jPklhXivZIGkrRBg8tioC/FJnmcxn0Er835JXAG/WkUOJFaG16KqveA1ew B9ZRR54EYuc5Tu5nm48rZ353cBJS7bU/tDAbaYPskIh1+Kho3tragduscK2BxbxBHZBf d/8fUg239Kx6jG15h5tsA2SAdhUBmGRH6OdhnV1Es9f6xoH97759D5BcH92arbWc3rJx TLedmwoE+ZcgXi1tagc2KWjNG4xcnNGZPHjpqIffgYA5+wsDwoohab3Or2QuzqAJZyo4 xNZrDBE1ZjoXg1EP5lRG6xFaPAUu0c4BngFDmpfip/XpwC5+EItpPKaMU03XDSP4YjBq irKw== X-Gm-Message-State: ANoB5pmStD510ndEc7dThHtppwLP3oN0KbYFNqj/aUwHhDSsBkAN5OnT ftueGwL9PyGLRo4vXkPGQoFK8w== X-Received: by 2002:a17:906:2e8e:b0:7c0:9805:4060 with SMTP id o14-20020a1709062e8e00b007c098054060mr2111777eji.38.1670498281701; Thu, 08 Dec 2022 03:18:01 -0800 (PST) Received: from localhost (host-213-179-129-39.customer.m-online.net. [213.179.129.39]) by smtp.gmail.com with ESMTPSA id fi22-20020a1709073ad600b007c0d4d3a0c1sm6388329ejc.32.2022.12.08.03.18.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Dec 2022 03:18:00 -0800 (PST) Date: Thu, 8 Dec 2022 12:17:59 +0100 From: Jiri Pirko To: Jiasheng Jiang Cc: leon@kernel.org, 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 Subject: Re: [PATCH net v2] ice: Add check for kzalloc Message-ID: References: <20221208100603.29588-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221208100603.29588-1-jiasheng@iscas.ac.cn> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 Thu, Dec 08, 2022 at 11:06:03AM CET, jiasheng@iscas.ac.cn wrote: >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]. Are you sure?? >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 >