Received: by 10.223.176.46 with SMTP id f43csp1342205wra; Fri, 19 Jan 2018 10:06:29 -0800 (PST) X-Google-Smtp-Source: ACJfBotHiEc0OCC9gNgoUjHgz2jyYM9MS3PUfGp/csFfsaSjmQCN15B1xlqTqKwBbcZ1FnQ9CMYP X-Received: by 10.98.129.194 with SMTP id t185mr19639997pfd.228.1516385189083; Fri, 19 Jan 2018 10:06:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516385189; cv=none; d=google.com; s=arc-20160816; b=yCD3Qetscxslxb0UZVU2LxdjHmMdRE0N+NXXHY1ZJFHHc7kkR9pr7u0swPLRnAdyqY uStuK1giSS8Q59ARXsBHAkzaz6JW/h+xMpDMJSqPLPiwtzHiiyV1LSaWAKOGLJnOJvZt b0BbDCJOlo4CBw1Lx9DPA28BEFvZlQvJ09+dIjQgPQ10dfQi8Z2qSFgc89UAzGddQV0N MGrXP5d7YVJ/Nk2AilvrO+O9RXUAYmUMZDmwCTNsgJZwAD6vj16ylEVIUH0bcS8DNfE0 JjUxxOMojZN+E11LUSLjtSZRD+C+Qpn/beQRq9BQav9PiF4EIw8k8ufDWozWdLUftfp3 ufJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=MrNJuextgzQy1SRslMSKeOd9baDnLB+ERvpUtktv/uk=; b=b/aqn2qCTI1GIteTE8SuzLyHwA1FAUn33wZ2KhJRXYJ+rzSel+VGwbLiMGrvxcPuBJ KsqPgfBUsFvwFQ7l/1IOnnpGSOJlL8mp0+5i2m/EM1TPhZz5nkpeVqGet613uuZtwhaV WR8ugT2Y5Z0HYQM24TNNsoczykneEDLa9pC44do7avWqPyHVmlpIl17EqKwbc+Zk3IY3 skkrktG+VNHfwrFRdytdagUdPHSzLZDQ5OcLRLnHHBicHarHRLEbb0at1NBDjHfgCs3i u8qVrxHljPmIoKpUowZTs097bRhMkXOsqvi9NwDJAXG3aGVVyTXjOfqwVtu9f1JOz0Nv nxHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si6688611pgp.337.2018.01.19.10.06.15; Fri, 19 Jan 2018 10:06:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756005AbeASSFQ (ORCPT + 99 others); Fri, 19 Jan 2018 13:05:16 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:42650 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932231AbeASSFJ (ORCPT ); Fri, 19 Jan 2018 13:05:09 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990656AbeASSFIZHxOI (ORCPT + 1 other); Fri, 19 Jan 2018 19:05:08 +0100 Date: Fri, 19 Jan 2018 19:05:04 +0100 From: Ladislav Michl To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wolfram Sang , Bjorn Helgaas , Greg Kroah-Hartman , Thomas Gleixner Subject: [PATCH 2/2] PCI: Fix double mem region release in devm_pci_remap_cfg_resource() Message-ID: <20180119180504.GC31540@lenoch> References: <20180119180310.GA31540@lenoch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119180310.GA31540@lenoch> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org devm_release_mem_region() is called explicitely in case devm_pci_remap_cfgspace() fails, however the same release function is later called also as devres release of devm_request_mem_region() causing double resource free. Fixes: 490cb6ddb17d ("PCI: Implement devm_pci_remap_cfgspace()") Signed-off-by: Ladislav Michl --- drivers/pci/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 764ca7b8840d..8f9d81a23ca5 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -3607,7 +3607,6 @@ void __iomem *devm_pci_remap_cfg_resource(struct device *dev, dest_ptr = devm_pci_remap_cfgspace(dev, res->start, size); if (!dest_ptr) { dev_err(dev, "ioremap failed for resource %pR\n", res); - devm_release_mem_region(dev, res->start, size); dest_ptr = IOMEM_ERR_PTR(-ENOMEM); } -- 2.15.1