Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3758895pxt; Tue, 10 Aug 2021 10:38:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhG8bRIWU/RsdOJvlPSwZVLjLNj83e+i5Q6yCOgYQCMSLPFmISvBRWpqdgEAZR70USQg5W X-Received: by 2002:aa7:cace:: with SMTP id l14mr6333955edt.14.1628617122519; Tue, 10 Aug 2021 10:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617122; cv=none; d=google.com; s=arc-20160816; b=eakq4ZUuv1vhT3TDY005SSTYevxEqcCHY/wRN/yHpAXsJVEO8FbPC4gy3byT0EXncJ 6P+SlY4wGHeC9iiJ563Uin7O1q0H8CEU6QTi4dlDpYROyY7FcwkqcQBSvU91aoSZLkFV l2yeAFVBgGNfWyuztNcDqgx+7ptTk6CRvWESE8wlOdk8fi9ntf1/euurhjZw55Mlq/z9 gzQMbXO+5gNRToU2jNWz03JINJE7uKqd7JKOdRJzvwEhhYkJ5dFSAH/Dn9fYlhmxXYm5 Yuf41vXnUOfh0aY112oNRwjMalDZPVRmIn62YcroEUIa+B//u6FP+CTEfO1PNILBn2nP ekTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XBSowPGGkbC9+5XFczNrJaJ/P/8g9RT2rDWTTFvI8RU=; b=HbBuNFdGf2oTh1evRbUuwFH2ra3DfkeEFclKzr8Kb8DCbz8atbvB6OcbEM56to7HbM eoO8IZ6uddNTxQU1afOn0IicfTtmosqWgRAqwI7HsJZgLt0woQMeTs45BB+bjhf4AQ7u dYoaIh+H7xC7Y83bEQQQzwuJt1Lu051EAxSH4ljEAX3sG2r5kwRWnyzwY98LIiE+o2T3 4pG9iVQARy+07RKzAAfs+zxUoZkLQ2GRCC9iUPapU+3VBNjWOdF2hThLAmsnhP2CO8it WOnSXbxzX84vjRE6fd7LDZrRAjd30NlDrfTTk7pRYG5TTGi3s68Lg/0r5JnmwiLKS+Is +eSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Dp6Ljh84; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ch14si10391116ejb.650.2021.08.10.10.38.16; Tue, 10 Aug 2021 10:38:42 -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=@linuxfoundation.org header.s=korg header.b=Dp6Ljh84; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233747AbhHJRfn (ORCPT + 99 others); Tue, 10 Aug 2021 13:35:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:42010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233022AbhHJRem (ORCPT ); Tue, 10 Aug 2021 13:34:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3AAB6101E; Tue, 10 Aug 2021 17:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616859; bh=sd/DQSclqnWoKrgGmCyb1px2JmDXjqqUy17k5WsDmh8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dp6Ljh84RJt+oYA2k0TQ7W8cRtbDKibKyGzBdly6C8QvBrUYU7OtxKfFnfDL9ksnM S4O/xEq+ZhwJWCB7S41BJvOTWRkzaRz2iKwWCagxnJtOWknelK/JJwlmGL6ZSKbEzw 9xJoofkU259NTi7LgQcBm96x6EBrtteRpbklrZ0Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wang Hai , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 24/85] net: natsemi: Fix missing pci_disable_device() in probe and remove Date: Tue, 10 Aug 2021 19:29:57 +0200 Message-Id: <20210810172949.012649660@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172948.192298392@linuxfoundation.org> References: <20210810172948.192298392@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wang Hai [ Upstream commit 7fe74dfd41c428afb24e2e615470832fa997ff14 ] Replace pci_enable_device() with pcim_enable_device(), pci_disable_device() and pci_release_regions() will be called in release automatically. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/natsemi/natsemi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/natsemi/natsemi.c b/drivers/net/ethernet/natsemi/natsemi.c index 1a2634cbbb69..a653502c5d6f 100644 --- a/drivers/net/ethernet/natsemi/natsemi.c +++ b/drivers/net/ethernet/natsemi/natsemi.c @@ -819,7 +819,7 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) printk(version); #endif - i = pci_enable_device(pdev); + i = pcim_enable_device(pdev); if (i) return i; /* natsemi has a non-standard PM control register @@ -852,7 +852,7 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) ioaddr = ioremap(iostart, iosize); if (!ioaddr) { i = -ENOMEM; - goto err_ioremap; + goto err_pci_request_regions; } /* Work around the dropped serial bit. */ @@ -974,9 +974,6 @@ static int natsemi_probe1(struct pci_dev *pdev, const struct pci_device_id *ent) err_register_netdev: iounmap(ioaddr); - err_ioremap: - pci_release_regions(pdev); - err_pci_request_regions: free_netdev(dev); return i; @@ -3242,7 +3239,6 @@ static void natsemi_remove1(struct pci_dev *pdev) NATSEMI_REMOVE_FILE(pdev, dspcfg_workaround); unregister_netdev (dev); - pci_release_regions (pdev); iounmap(ioaddr); free_netdev (dev); } -- 2.30.2