Received: by 10.192.165.148 with SMTP id m20csp3954381imm; Mon, 7 May 2018 23:51:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqUj7MJTB9yBiZywzFzqEehp1gjNs1vzGPtPlL10WoDdH/L62Hyx/gi36vjXaKEoRlcSUaJ X-Received: by 2002:a63:6dc8:: with SMTP id i191-v6mr30947212pgc.291.1525762273311; Mon, 07 May 2018 23:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525762273; cv=none; d=google.com; s=arc-20160816; b=ZOxO/c7G0h0E3fQTtTtDhOAxHpnphy8Rb0Nn2cUeLtM/02kwvTear35Fgwcbi4Btk0 5In1SdnBI+x8ZQkmWD/rif0ZamSDF8Mk3HTUKU9DJwsBLAHtWTSZqYeQMk1ynBrYClDN OcG6+PImttfdL3xCogM5Nhn4rRXVHBI/8sC7ZEdONk23KQONwvK8lt2UNDpzl7PkyIJP rol7xBx0oZM04E2EppBI9tcUq5aS8OCKGv7RfsGSQYkRFeXPouqDWIFF6ZSCyJX4/lPG XOmGWH47r5hxjzB3pq477MJtDrLETkjLoO4DAn/CEQggvCuswy1kJDn0GtF/LEnn6Ldn aN1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=sdU2oBHBPpgJlnZhqaFRpyA0CrAoIA/p24S4KE46klU=; b=qdTIuH+JBKcgBFuyVAzU0Po6CN9//DmgL0SP26GM06QHNcQd1Bd63ozH+gmRfrJ44p nBT52gZeJj4ilpH7SR2NpWFPrw37GoSGlJSCNV5svzTfAx5Mvl5bqA6rA15xQJM1HWYf SJWc55EqkVwN9bOSe1BMW7YEfhuLAfMYH1N596cxxYlYYmp0vsKixRfMMOugXdTcf/g0 ZGFsbrOirU3yMiv2zUlNnYUaL8bByou5mfcBRN65tgCRnSgi40Bu8onD/y2Jw5gKqTp0 Y5MaK6/SZbUUSZCLJesGzxh2RgMU7aTeJUeLFBe6yJTIm6gbPOua1SaEa+1SiPb9+Y5I RwMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w63-v6si18840270pgd.32.2018.05.07.23.50.59; Mon, 07 May 2018 23:51:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754372AbeEHGuu (ORCPT + 99 others); Tue, 8 May 2018 02:50:50 -0400 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:18705 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754201AbeEHGus (ORCPT ); Tue, 8 May 2018 02:50:48 -0400 Received: from ubuntu-CJ.home ([86.244.116.1]) by mwinf5d79 with ME id jiql1x00701t9Ri03iql7X; Tue, 08 May 2018 08:50:47 +0200 X-ME-Helo: ubuntu-CJ.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Tue, 08 May 2018 08:50:47 +0200 X-ME-IP: 86.244.116.1 From: Christophe JAILLET To: davem@davemloft.net, igor.russkikh@aquantia.com, pavel.belous@aquantia.com, weiyongjun1@huawei.com, dan.carpenter@oracle.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] net: aquantia: Fix an error handling path in 'aq_pci_probe()' Date: Tue, 8 May 2018 08:39:47 +0200 Message-Id: <20180508063947.11317-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The position of 2 labels should be swapped in order to release resources in the correct order and avoid leaks. Fixes: 23ee07ad3c2f ("net: aquantia: Cleanup pci functions module") Signed-off-by: Christophe JAILLET --- The order of 'pci_release_regions()' and 'free_netdev()' is in reverse order in the 'aq_pci_remove()' function. I don't know if done on purpose and/or needed, so I've left it as-is. --- drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c index ecc6306f940f..b7f6b5a68b33 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c @@ -298,9 +298,9 @@ static int aq_pci_probe(struct pci_dev *pdev, kfree(self->aq_hw); err_ioremap: free_netdev(ndev); -err_pci_func: - pci_release_regions(pdev); err_ndev: + pci_release_regions(pdev); +err_pci_func: pci_disable_device(pdev); return err; } -- 2.17.0