Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2739698ybz; Mon, 27 Apr 2020 03:42:28 -0700 (PDT) X-Google-Smtp-Source: APiQypIcH1ktch8NJ4qpN7eexXO7LzNAL9gYS5MT7tPSgSKlNMl3bO3SMHp/jJsWtMosBvMsX8qC X-Received: by 2002:a17:906:c281:: with SMTP id r1mr19403913ejz.310.1587984148563; Mon, 27 Apr 2020 03:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587984148; cv=none; d=google.com; s=arc-20160816; b=pLCTHmE0lXUd31ST2+YX5bMNyMFP/p7EA+4lRGFaUZCTuSy8cOj4qBD2+bRyDxoPWh w4swuE4yfTI1M3OKgdZuLf7P4AfuWlAbSTyA2sfXPuxumEMAm+36wFZ7mCSUAyrLgL/u urMknQFDaDdZGcTcbS2q7vEdBfUx0ujjZk+B/h0CJ8dlNGkKxsoHFXBpGol+UnadvuJ1 RFAzY1vW19EiKBK/iqhLOoUAa8nFDZe6GqzCBpWMx9FA0MUXtcKQ85O6oimbRtjNfgJ0 fpYnzKBg1QoLnhosgrim3L+LwZLVGDY5MBJPkWAV76agvt7v9eJVGImXeKWgJJnlAnKe /VhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MW2w6cYBsYnn2GfMNP4KPWcf4PUGwZkZaGYmrXU7CiE=; b=yPwymwHqx4jX9YIZgSEhwn++595YS4Roq9A4H1Kj8syQ3ArwbJDSoR0WMtlvDYyw4j e+N6Hx1+iyVCPuEJ9aXRHrQV3upzJF0UANWI+SmXtZmbdcglWRQtndvnsHO8NPsPuHpq EftPZlYOicFz5olgWgzoPptlm0T5DcUoDryfeHB+0LkDqG4xWXH/kO42GkTK0hoq2uGj zwKDrVRY4eqLvbx7MzJjZXngUYuo4ff+KtzPo+J86nupS++emibhGqp/G+jWlAFvcj2v UZjU8vRnKzw3evE3PjSCn59WzI8JgDjcyRQNfTs4snULC/2oHgT60BhMmquCFqC8yY8q 5/kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eOFr0yND; 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 g11si8244502ejd.148.2020.04.27.03.42.05; Mon, 27 Apr 2020 03:42:28 -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=eOFr0yND; 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 S1726978AbgD0KkL (ORCPT + 99 others); Mon, 27 Apr 2020 06:40:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726507AbgD0KkK (ORCPT ); Mon, 27 Apr 2020 06:40:10 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E2CBC0610D5; Mon, 27 Apr 2020 03:40:09 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d17so8533650pgo.0; Mon, 27 Apr 2020 03:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MW2w6cYBsYnn2GfMNP4KPWcf4PUGwZkZaGYmrXU7CiE=; b=eOFr0yNDPSp7q7vgtgoOygCFVuXicOnsYIZSmwXP/zm9v21hH/m7B/9Hb2oMMFGHtE TJzrxfZ/IsHx/xL3A7nixEZzZPfnHCrnw8nzcs//XtbBamVbtFXprYWr8CdrsUEwVDnl m+LALk2hUIhF1UQyeYIs4ShIX/2a3QKNuQFMmlS1d6rzaU9cL0kpN6c0Y9u1hCINiwbt 8ebIwtQZbg/wzKk8WmSyti2sXvpcZYxvGfqG62viprQM05ppWoPzP22naKqsE2zI9Nz0 GoFYv4ueHnXM9uit745vpKHQ+DsDf0rlPt7RzendHla1sGLLQJEzc0ktoxqy/uj+e9Ds G/4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MW2w6cYBsYnn2GfMNP4KPWcf4PUGwZkZaGYmrXU7CiE=; b=QwlqhJvVweU9XCoeblLSiPVIOLRuXuwl2YKJUtLhTCYU+A2kvDcf4Lim7H7YZ/MzeT 6qdFVrYmpiN+tdNSwyaendy5pkhrKboB+yj91YfC78CoUMqCNIfxIJJSNUdjbI37dXMb MifpRWQFzYqT73N/EthM4PsRHM+H5FaRKujSNj1u6G+2ow2++ZgGLA06lCsWX8bq28Sc 01FMinam3S2kpEkM5eLvMV5cnlMp9Lq2IXqYoLBMnQj280Tj79RCWAW7EFHSffwWnqGb 2XnHAoiSiIPSpYPGGrpjDZffZsF+nXiGFHElYLKMtTwzdE7smIWngwB13PvAIriiw1rt pbRA== X-Gm-Message-State: AGi0Pub/JHAvto7oc9AOe4ho9+ov4duCWbkXk0+CEnDJ4W8y91c8Hh4F UC6t8jsOjj1KsRDeX2TYtDB+cE09SXC+ImgYFIY= X-Received: by 2002:a63:5511:: with SMTP id j17mr21751878pgb.4.1587984008659; Mon, 27 Apr 2020 03:40:08 -0700 (PDT) MIME-Version: 1.0 References: <20200425134007.15843-1-zhengdejin5@gmail.com> In-Reply-To: <20200425134007.15843-1-zhengdejin5@gmail.com> From: Andy Shevchenko Date: Mon, 27 Apr 2020 13:40:02 +0300 Message-ID: Subject: Re: [PATCH net v1] net: acenic: fix an issue about leak related system resources To: Dejin Zheng Cc: "David S. Miller" , jes@trained-monkey.org, linux-acenic@sunsite.dk, netdev , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- With Best Regards, Andy Shevchenko