Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp872983pxb; Fri, 13 Aug 2021 08:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC8xj6hO+AuxhwgY9ZUTMnUrAOkEnlEcdpD4zxc1TtBOPRVQQkokFPLNzDGG0JrYG0gXEy X-Received: by 2002:a05:6402:394:: with SMTP id o20mr3698518edv.232.1628867443875; Fri, 13 Aug 2021 08:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628867443; cv=none; d=google.com; s=arc-20160816; b=GTMYztDlZl1qbl8hcqDMT2Pby5Rco7O0YqhfYZ9dZq137hEOxy4KzVuqhZC96BxN/1 PMquVG9Dk5VM58NUTlEbo7dbThsQBWXF4JnaSkKerZWauy6Cec7ugcFbIcEykoBL63z1 fRcURZeEUSNrWtVqrFohb7S/nK4amZPM1MiGZuyptkdw5R6/KLDxCOi6U62DjFDq5Ayc pKblswDhpjBiWMbKKPMejbMVoYM0fGJnL/YPrEgRPzb7mCVMkY43lFp5a1f2xatZv2x3 JbQH3P+DtMC0knkgXUu96b49uFfFd4MPEcJIxlu4LwQA5VeKM5jyS4hSlrdNeuI5N1we ceCA== 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=rTtQlE4Lytq8+UvCb+QGXB3CoUXclc3OOMnapcKxQiQ=; b=e+SofFONUobmaH1T/GRGHN/5QLArKhs06IYl1aH5CJQ/5gFWPJQzfCLzJikZXYUO5d AAp9B+0lyC8jw9z5T0rAlP1Iv3hX0/LO2miED5BAsbFyy75D0ZyF608icadzAvX228Ie RR8dbK2lA33P/URWiaE9OZ/kKNBPBV/ilE/938oFKA+GTtvSb7phl32/bq7N52RbssZI NKU1N1Ahf2PlyXiod1Y1615VTL1rNxCMEc31Z9NDkzcuvOx0QoHjuM2JnV2dvmJpqMr3 Bt348INAcKJ8tl6PtXvoAY6lS+H+yXm5s1SCRr/NFabvutJwWpGAC0hPxPCxWPuZ26lH S5NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JOS+uM3a; 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 h13si1900055ejs.401.2021.08.13.08.10.16; Fri, 13 Aug 2021 08:10:43 -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=JOS+uM3a; 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 S241153AbhHMPIg (ORCPT + 99 others); Fri, 13 Aug 2021 11:08:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:50780 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241123AbhHMPIc (ORCPT ); Fri, 13 Aug 2021 11:08:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5318E6109E; Fri, 13 Aug 2021 15:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628867285; bh=ZvhGvJNzjXWCpSiOHxmHHy8hjNHLrQl0CUUjDzJJ3ZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JOS+uM3aVLFnUKN6yx+wC3jxbxtqyqT5jclnxt+XF3DT4TVLEEpULRNv2k6y6MMSY WROWXqPcXn9cpnd2f2mlGTZLpTYXoZyXbPF+YBuA9pOxcUfkpoIVljQKfmY5ZrgGJC PjFD8ffRQMo1MOLYwFi46C4f2Sk8wWqB3mYaRe8I= 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.4 04/25] net: natsemi: Fix missing pci_disable_device() in probe and remove Date: Fri, 13 Aug 2021 17:06:28 +0200 Message-Id: <20210813150520.866473423@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813150520.718161915@linuxfoundation.org> References: <20210813150520.718161915@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 122c2ee3dfe2..58527a2ec455 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