Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3764661pxt; Tue, 10 Aug 2021 10:47:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQHVB9EdwF0E5hkR7vk9tH+ZOrkvUmsoSaDqSVkMkYWkIiCtBi1MAKWxB7Pt7lRo87ur/3 X-Received: by 2002:a05:6638:1036:: with SMTP id n22mr28302882jan.81.1628617622181; Tue, 10 Aug 2021 10:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617622; cv=none; d=google.com; s=arc-20160816; b=dfvzXN15hhAH4gjWHa7tVhS0iSzP5PHa9jniubK89FkCArnIMJ02BEgbsLFO7iWCy5 jIxJLLvb2am/TBGrNBLoJjCM+HKH0lERIAUu5mIH3byKX+L4lJu0rJ4bobV87uqM8VWf fkTRuK+mQHsrjeJHR+FQMk2WkWXUtlXSHkTyuS1ck5va2TtvWyjnz1BgCn3J3PC5/BbC JSPlPwXAPzzqqu/orSv4RhdbqkWpea9jHTafMqzpJuhtVYdRh+uNN0QEwpjnp9ZEpWg9 1MAg+6o9bh581FMOokXD43L1QJeg0ulROhGW3nNfmyVvYYAHRvle0fyoq0m83zvJka1e VZyA== 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=gC0K1BS1ajJEZ4fgDv9orJmp/J4hPOF8WOMWlI08EBo=; b=YbnP3jNHCLKITdJk4+gl2Cogwy86RzX5FuKrnwmcEaISHkzni3pRFAHwNjDuQfn/+K Bb2pWwkVyU7Tk/bE2sXl3kmfc49Mmtuw5aMNGIwk9uVlZrsMaKns4Gw/vTZz1PncOAsZ XfzmtsL8UNDGtJ+0kwuh+8E/i+WwpUkfVPu9YPMg2dcYrVuBpPukKiSIF+7iLadd9UgK /t+bKDRHTaer1/f38qkiNgIp7FCPp+bal+TbEFLdxz8Kh+ZpV7O7cLkQ/cubwt02NHiv /cZvfGljIfROmhp/DdzqcDcpdVWmP7us0TODmZsKEvPHNaawO6Q7xUIhTghi06g2MWc/ VqhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J5OGKTJj; 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 u10si21977719jap.71.2021.08.10.10.46.49; Tue, 10 Aug 2021 10:47:02 -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=J5OGKTJj; 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 S233062AbhHJRqS (ORCPT + 99 others); Tue, 10 Aug 2021 13:46:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38840 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233665AbhHJRnJ (ORCPT ); Tue, 10 Aug 2021 13:43:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7193560EFF; Tue, 10 Aug 2021 17:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617142; bh=8T2v0KABr0EE4NnSDFDGDvowLI6RwHuQleLbm1JGzvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J5OGKTJjeTPK+X4gl83+PUrrxa20rPwsL1mmExnJxJ+55F96g6wrh4D+MCW/+ylPb Q048zam1WhSZDRZKwGxlEDItBlKWrgfmbbIfIVjOOsnOOIFgAUxTOq/8muUQRQTply OwH3fci/QfGHxU+wkeO/jC1fXNMhJKCSJ0t3Hsgk= 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.10 036/135] net: natsemi: Fix missing pci_disable_device() in probe and remove Date: Tue, 10 Aug 2021 19:29:30 +0200 Message-Id: <20210810172956.903669691@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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 b81e1487945c..14a17ad730f0 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; @@ -3241,7 +3238,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