Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3757662pxt; Tue, 10 Aug 2021 10:36:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVNy6arXsGjva8vEoOFcmJLm9sHWFiTO2j2DPjt+TfuLMRX2IerW4KIhuuY8WJODZNJzx8 X-Received: by 2002:a17:906:5306:: with SMTP id h6mr7950328ejo.248.1628617007991; Tue, 10 Aug 2021 10:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617007; cv=none; d=google.com; s=arc-20160816; b=R9TqjexDJanzfzZxaj3OSsm/wUp5IZxDJVSVibzO1ma3sgMzyRkuA2F5YwsqrBla9R lr81JeQvU5MwBdg+ppCncDtXXNLo0Hb5nTQYHOc4IxRheRYldfMaSfvyPatL4KsB0S7h svlwB6sTSABJkGNP9Du82j4FM1OrVW9HMO8Hs1S2wpRLg9Os/qgttyiHKY3UQkfzYIWL txWPufJoM8F66boFR0zIWaQpJulZ4nIXW4ys+l7ooMcNEiIxQyg33Y8CddbXhPwKwXqI DOH192JEkhHoWU5n4KjyZ/FYX/eS5fcDjNyIL527Rm2qCMlEmzAy61/usVXngmE5tBOn JHFw== 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=4XS2915eL9LmOcnQ27j86ABER9XQ/0hAF5Ji6Awpzdc=; b=AIPF2tFzZ1NouGjEbyjd3kSv3zse9wpEqdjcIEAscFFt8i4rbIqIKRzZTjUKXtU/ov 6LUqRw3htllnHFirw2ytLADZA6SVCf1ZP8N9CpiooIoocaLsrjIdtS7L1mGidy7YEYo3 FRp+J2QxZbR6g4mAa445IZbCctZrvXaQxMN+h4fGshi6ieECu6TsoSgbRF3tH6lB6fUF 3x+i10c6oeRfdiWJf9Lx20+CRgcw9YKlOxNYy+ORlMsnK3UnvE5UOOzyMNojlwPFWjjY lP+k8EFN6WbWLuVN9L8pXfvJFfiXTRbuGtv5mF679LlJBfK47fSLdRyqz7KQk9lifk51 hmxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OMdrzG3m; 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 ot3si6441904ejb.721.2021.08.10.10.36.23; Tue, 10 Aug 2021 10:36:47 -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=OMdrzG3m; 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 S232577AbhHJReM (ORCPT + 99 others); Tue, 10 Aug 2021 13:34:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:35348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232051AbhHJRdW (ORCPT ); Tue, 10 Aug 2021 13:33:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC67A61058; Tue, 10 Aug 2021 17:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628616780; bh=Y+BfJmHVErPxx7QiD3yq3ZCp68mFYboU1/QT+CymW24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OMdrzG3mtxJUgM/PwgdmSp8nIkKNkORqFAUFRCuH4mafBWu8y690xyvxQMQOzD0Dq vKSmlYY58csut52cn4vP8cZta4qg7flxRS8L2U6LtUOsfvwTfPiMXF2l0yTcWBitAL 4/c/Uv+Cj1aGCZsHsfcFSqdUUnxyuZNYosss1Bww= 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.19 10/54] net: natsemi: Fix missing pci_disable_device() in probe and remove Date: Tue, 10 Aug 2021 19:30:04 +0200 Message-Id: <20210810172944.524834253@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172944.179901509@linuxfoundation.org> References: <20210810172944.179901509@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 b9a1a9f999ea..039d5dd98dfe 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