Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3635969ybz; Mon, 27 Apr 2020 20:14:57 -0700 (PDT) X-Google-Smtp-Source: APiQypLJCu02k83+YDZL5onZdvPyDgoZAb29RCPAz2xc9+ocaXmzI4WCtK+qNRrYJHZIw7hpmaq6 X-Received: by 2002:aa7:c401:: with SMTP id j1mr20577659edq.31.1588043697659; Mon, 27 Apr 2020 20:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588043697; cv=none; d=google.com; s=arc-20160816; b=eCrFKPFGrn/WhEvAQfLC74fPAGQyJXmL75R+jtnno9LtnpV5RAbV/Si84Cz8ffi3nT z+JSxeGXY3UyrAeaEXNjnaprHL9aJDeB+zh3NSBTgNunhlanE6iEJupAnJfUpYd7QzsH I7ZOfcAlHj1P4m7zSTGBxT1ZAwhVCUaceLmNIEf8RwdSQVKAPU5be8pvl1+0FZBYsKKi o6qlbqezT+kCBqn3xbKXvB3k4w3W/A4LE6e/ylPQwe9o3bcDW4woiAKKP/tcebMW/boS BZFBPfY4mFqJqRn5EPzITvPGTfYgJbUqxf/JNpCB3zWixqJxyR/cgF7zFTTfpnyI+OqJ TQcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5DQBGmMU3Xnx4zkIfV2JJgQ1wnCTPo/vNaQ63QI1rwk=; b=typhxFqmfOra2MdKyRdC8gR7xPS82/mUjTjex+NM6mJjvZwz/7Rz9Q5POeSrKCXBac vXJIjPL/MoAp6YGu5RiJG74U5m9J9cMKOPFSEtXb0QzP4gqzZ9BYxI4ntvExaVu0/ftP D6/3R1kV6DeQeNp9ycXhE9nvQ5mdNqc8ZoPVWRBqo8hFo6/gzZ4Kuq88NXwIMox2Rogo okVaphmtxi14pavBueMLI+e7orwUtmUAb61E2GzBlDyT9WAK37nTeAbqutX7Zq9aRrUS bi/pZot03ArL41fTbCorK5NTjfyAnb90wlCY8aBh1TtGqVnlM6tTHqoQfAdpxM4NuE/O Ng8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Aw7hWpM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bi10si931603edb.465.2020.04.27.20.14.34; Mon, 27 Apr 2020 20:14:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Aw7hWpM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726377AbgD1DMy (ORCPT + 99 others); Mon, 27 Apr 2020 23:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgD1DMx (ORCPT ); Mon, 27 Apr 2020 23:12:53 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C46EC03C1A9; Mon, 27 Apr 2020 20:12:53 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id 18so8784665pfv.8; Mon, 27 Apr 2020 20:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5DQBGmMU3Xnx4zkIfV2JJgQ1wnCTPo/vNaQ63QI1rwk=; b=Aw7hWpM6yrSAEef95p4A+fq2dxuXjMhWn0bVzpXIAMgQOO1kmH8QMc+O3beMf0M9VG GCAlZ1H6xuAejpvFWGYh8igmPVO2c6bX2vlntcOnxOm4dUmoqZ/zUFvFqN0k6yvj15pd KCQxhm/pwbOQsJjRnKr4O9XA9p5AH+lV9OR9wS+3DkynFKzvBE5+WBJwLF4gkGwfZ/Vj v92b/EcpdvUUD6tmHcDSp7RIvvWhq2sDNqgr2+LGr+rvfgaVngyCxziniCyy14vGE8rk aT7csKTwDpjbgWnSXsxJ/KtVFyjA8I0CSqR6eXbzkJb0KojGWHuGw0M50DACVJrsY2m0 zVgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5DQBGmMU3Xnx4zkIfV2JJgQ1wnCTPo/vNaQ63QI1rwk=; b=We9L20sl+NwuKxLg76tB91ZqL+s5wSiMalOrZko/AQbvI0FqBUjFl6AeOvvGxoSIIb DfwfYeDfIByHm9FHtRIWioVF7sDIFfx6YV9K0KogvChCdzCDtrzuAfMRwpJJfAgGWY9q KeHIh+fqvwI5f3nmejwwlD/zrjfkDgt4WnVlNBJwo/4i9uq1D8DShsNp0J6ibujYhUZn kTE6V18ZBY2tkd1dEf6x0CABphau1/h2x2ldzhfCh2dVLp8pJXPfYLrIsvhha0o4fZ2e 8SrVURbIxcz214w5a73vPrzOWon7MX/NIDRlPPVOX5gLUb+ZPV2SWwF1LDJyNk1dWKm3 /ABg== X-Gm-Message-State: AGi0PuZW+/fndiUOFogupV8e27Pdl6O1sL65XxCAvnAf0OSv+rj0wmcb QQz3KRueiU+pAyIto+TmB+o= X-Received: by 2002:a63:1a1e:: with SMTP id a30mr25261543pga.368.1588043573046; Mon, 27 Apr 2020 20:12:53 -0700 (PDT) Received: from localhost ([89.208.244.169]) by smtp.gmail.com with ESMTPSA id u13sm601745pjb.45.2020.04.27.20.12.51 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Apr 2020 20:12:52 -0700 (PDT) Date: Tue, 28 Apr 2020 11:12:47 +0800 From: Dejin Zheng To: Andy Shevchenko Cc: "David S. Miller" , jes@trained-monkey.org, linux-acenic@sunsite.dk, netdev , Linux Kernel Mailing List Subject: Re: [PATCH net v1] net: acenic: fix an issue about leak related system resources Message-ID: <20200428031247.GB31933@nuc8i5> References: <20200425134007.15843-1-zhengdejin5@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 27, 2020 at 01:40:02PM +0300, Andy Shevchenko wrote: > On Sat, Apr 25, 2020 at 4:40 PM Dejin Zheng wrote: > > > > the function ace_allocate_descriptors() and ace_init() can fail in > > the acenic_probe_one(), The related system resources were not > > released then. so change the error handling to fix it. > > ... > > > @@ -568,7 +568,7 @@ static int acenic_probe_one(struct pci_dev *pdev, > > #endif > > > > if (ace_allocate_descriptors(dev)) > > - goto fail_free_netdev; > > + goto fail_uninit; > > Not sure. > The code is quite old and requires a lot of refactoring. > > Briefly looking the error path there is quite twisted. > > > @@ -580,7 +580,7 @@ static int acenic_probe_one(struct pci_dev *pdev, > > #endif > > > > if (ace_init(dev)) > > - goto fail_free_netdev; > > + goto fail_uninit; > > This change seems incorrect, the ace_init() calls ace_init_cleanup() on error. > So, your change makes it call the cleanup() twice. > Hi Andy: Yes, this code is quite old, and There are also some mistakes in my patch, abandon this commit first. Thanks! BR, Dejin > -- > With Best Regards, > Andy Shevchenko