Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp958743pxb; Fri, 13 Aug 2021 10:03:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk+6/C8jLqnQwxNAFVrmSUDyriNS8+RjnRGurfST0dTVAp2bzr96qM/1a5cf7EWjtByBQw X-Received: by 2002:a6b:f403:: with SMTP id i3mr2811749iog.22.1628874239570; Fri, 13 Aug 2021 10:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628874239; cv=none; d=google.com; s=arc-20160816; b=oX3qqlVxhK7UZctGcwTewWAxqVhuj+/TNHNUVRcds2+uElXgR3xfBOpWLfT/Q62roT IH/zP7Y/AzFBO8v7kJKX04UvrpsY+JCGVeBGQr62BUjiJxXvus4+N22kZ+8OGz7I1IXq cnkesmRZPbd6t4huCsA/s8jeQrHvuVUwr/kLHRyF85cPP4BT/sejHZ4Oi32c7EUpumx4 nTRt0jwnAfhvapE6LhCxEZFJgXLhD9to+UIHGA7XgxYkJlfXW+1o9s5WJdSC6tDw7Kki z5Rqf6q1Hi1qnaYN1XZb6ijbnt0Z1y/5KfUzvkdKlJDqRW3k4BoXpzB11DQJYG7YnbN2 tXZQ== 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=fm5EFqcCut/RtvZL0Xddj5b3/OwxuqbCU5kVAkKtVKY=; b=BnuodIhFmcKov/oYzhTtUaLIFLNow9K0OodJInW+VHU7dytSKIpOyFBup0IlQ8d4TC 0xJIQBePFqpQysaEu9yZ1QBRxlynZJKluztAgPZZmPngqhPghVvFMTHLI7A6TCW/n714 DO4xrBvJXUr5M1nCZjbuNtNOIDHtHHhlTZScUXHu5BBbOwHReNDKzFEjlo6LzZwvH24F o7UuIFU1sbxrpdnrey9pPOzARn9SAHMnJ3V0ib23yuw+3K3/l/bqb7ta8hIsYeoHKbJu U62vO6oS+a5zaPM1ZCbyElQts1UKHehQdPagbRFLXiWtY9nd5TvL8VMcNDrsYffZikRa FPdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="idC/vgIB"; 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 i10si2617010iow.33.2021.08.13.10.03.47; Fri, 13 Aug 2021 10:03:59 -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="idC/vgIB"; 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 S241207AbhHMPKr (ORCPT + 99 others); Fri, 13 Aug 2021 11:10:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:53658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241635AbhHMPKS (ORCPT ); Fri, 13 Aug 2021 11:10:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE70161102; Fri, 13 Aug 2021 15:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628867391; bh=MgjU03Lq+0Es1eoX4Zw0RDcAaKz/37Q1SbHJx7C49OI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=idC/vgIBTjPDfKd2yNJ3TM3a/JakMJmaYYv4eYAhTqOwdOwE4+iIniGELNMVc3wJC 4EHul1aPvq8clxE10YE/EFQAJAknlUZwC/8mUDtS9unXvL+pwOx+b3YUih4H5JJip3 VaOG4+ZXDSzzaqwAH55Z6n9CcjoDGAm4tX1UfIYg= 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 4.9 04/30] net: natsemi: Fix missing pci_disable_device() in probe and remove Date: Fri, 13 Aug 2021 17:06:32 +0200 Message-Id: <20210813150522.585497358@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813150522.445553924@linuxfoundation.org> References: <20210813150522.445553924@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 ed89029ff75b..c0e128e17321 100644 --- a/drivers/net/ethernet/natsemi/natsemi.c +++ b/drivers/net/ethernet/natsemi/natsemi.c @@ -817,7 +817,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 @@ -850,7 +850,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. */ @@ -968,9 +968,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; @@ -3228,7 +3225,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