Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp897734ybz; Sat, 25 Apr 2020 06:42:00 -0700 (PDT) X-Google-Smtp-Source: APiQypKU+qblbCwCNGrALk0GI6CTw1bdfc6Qgz5Hxq+/iK6EUc2jwRiNN5XPIUeqtuTorjegw1K6 X-Received: by 2002:a50:9d42:: with SMTP id j2mr11565324edk.249.1587822120675; Sat, 25 Apr 2020 06:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587822120; cv=none; d=google.com; s=arc-20160816; b=ql8OlNrq2kRw6ibg+H6GezRfXgt7NPhsKP08HrYo7Gel0N9NrveoUtx0XkZD/89SLf ZfPFRRRA0IzqNzAUgmUz/80hncU+iat+hmXLC4VGNOW1qzzYdP6IrLddhEjyl0kiK97d x9oVi60aiGi3RhMS/sKduxzlJ96XfYTTQnoOj2+xmLEvDkC1adJf4hOEOzJ3bnndtKuT p+7uCsic8YAOcQ59KPxR/tRR6jYynQPdOB9f+8f5fJC3/huvCfhwRbjyTJfYyC2SoM3H kjdUlRciTrYTvqCvk7Q9A5I1T2UXpyF6mjENh3Wm7wZbPwV8YE8EPPhcVDoEFN8SUYP5 bAxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=u7erXItqduG4J9xeJjAnKDGo1ffse9a+ZFsfbSrURyE=; b=UJm2dIIKuILiTP4C1PeE5p18PPQ+gDbvqfPIbypsR4kpxu3f5mwSWmczC4cYSefs4a jJ5tZORpXxYdlB2kz2KTL0gU2/Kn0Dxv0UJxxw2B6lXVt0enKXRkO1wuI+8X7PGKB3gt pW/gjhUEyhx8IDTobMMnT6AJzKlVV324QNKsZFdJOca/wOsWSPta/RtthOfxXtKPbm9W CKbI1A34TspfDma6PSwNkLD6bdbGHNwlsAQEPDlZOMQ34ZKOreIq/LMvFQnIlxe4OIsi q8wJd92QgIkxFmAaQiIkZjanTXfWTt9xr3j/XHV5mW4qkCk8U8UHFTOhOXx30yVGsZ5b 0Bpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="PsG/d2K/"; 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 oh24si4941694ejb.531.2020.04.25.06.41.36; Sat, 25 Apr 2020 06:42:00 -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="PsG/d2K/"; 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 S1726119AbgDYNkS (ORCPT + 99 others); Sat, 25 Apr 2020 09:40:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726087AbgDYNkR (ORCPT ); Sat, 25 Apr 2020 09:40:17 -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 91F9AC09B04B; Sat, 25 Apr 2020 06:40:17 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id 18so5013317pfv.8; Sat, 25 Apr 2020 06:40:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u7erXItqduG4J9xeJjAnKDGo1ffse9a+ZFsfbSrURyE=; b=PsG/d2K/x/lFUqBKTSnjftACJ2hAinKNQkSC9RxL16xI0b6kseOdVUH06RLO5kyOOL J58FwmQjnquuhez0LaGVYin0OZRZDRL7u7Alz39WsXznmZgd0A4U+jWdsO188h5+3hAx zhf4TkVKw2VfKKHggc79Mlzy9QHqnLFcpLtwtJXfgH8VAvdUS0G+0Hj1TtSZT1cNnLar zJ11tSTwkzEiwd0MUx6OO+27Ry1TciqY6wTzGo1Qtkn95SLakvJnkROL/e0D8T7Ltsaw /4wyPeZ4LuRvhOV/QUEQxoTal2eoEmd2nlT78Z7rQzOBcn0nh3MieaSdrYghuz6wBGSt IVJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u7erXItqduG4J9xeJjAnKDGo1ffse9a+ZFsfbSrURyE=; b=mYveP8kIULH08Gg00EjtLPPH4yjEjwoUbSHkARxBfeZqubdD6d+oroaAORfDYEwRSm egqzJI/vZucbnrmUx7aWhqL16PeXJuv5xFXWbd9bSqEuCBLfw04Ihw658b/nFXekLEFi 4KPNuThEG4qF1zrke/GWkz9E+Rh1sviwjDfBA60EfMLp8LnskgABx9YMkKz5qy4Q3aJn w81yQ4joCO4jWFMu1cTsohnFrdOI5dOquiiiFprkiT1KiMI6bF+dGq8em1ZF62sTrYgg HuJqlhaSeAcx6vJIx4qIHDbqvf+6AswBKN82nOguuolCDhL+zgE8SVTEyXqXsOFoV/XM gllg== X-Gm-Message-State: AGi0PuYI6GtDfAS/S7rYuhdPxZZkeA2jnYPdbH/a5D5GC9Pcim2XEgjm 0mDCwbVD0p2GFqAidam1JNU= X-Received: by 2002:a63:2403:: with SMTP id k3mr13907764pgk.295.1587822017072; Sat, 25 Apr 2020 06:40:17 -0700 (PDT) Received: from localhost ([176.122.158.64]) by smtp.gmail.com with ESMTPSA id l64sm7359212pjb.44.2020.04.25.06.40.15 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Apr 2020 06:40:16 -0700 (PDT) From: Dejin Zheng To: davem@davemloft.net, jes@trained-monkey.org, linux-acenic@sunsite.dk, netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Dejin Zheng , Andy Shevchenko Subject: [PATCH net v1] net: acenic: fix an issue about leak related system resources Date: Sat, 25 Apr 2020 21:40:07 +0800 Message-Id: <20200425134007.15843-1-zhengdejin5@gmail.com> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Fixes: 1da177e4c3f41524e8 ("Linux-2.6.12-rc2") Cc: Andy Shevchenko Signed-off-by: Dejin Zheng --- drivers/net/ethernet/alteon/acenic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c index 5d192d551623..32f9e68dd323 100644 --- a/drivers/net/ethernet/alteon/acenic.c +++ b/drivers/net/ethernet/alteon/acenic.c @@ -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; #ifdef MODULE if (boards_found >= ACE_MAX_MOD_PARMS) @@ -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; if (register_netdev(dev)) { printk(KERN_ERR "acenic: device registration failed\n"); -- 2.25.0