Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp190594pxx; Wed, 28 Oct 2020 02:13:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiRuV3X6dAWcfMcul1Jg2YOb28DixiOTWtMsvNv341ScyHzOaOTGOubls1h3/C4HXBIp+h X-Received: by 2002:a17:906:e88:: with SMTP id p8mr6506510ejf.466.1603876407577; Wed, 28 Oct 2020 02:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603876407; cv=none; d=google.com; s=arc-20160816; b=wvGNuRB66ZlxSZIDJ8X4Y6IEEPaP7UC1d2AvuvfYDeTbTRx4Cmrunw0A3F+9GvO00l KWsEVmIr9i9JrCxuql3LU/8TU5n2o4cXqGfV3/jNVPkwDydW8f2uUMhPO6XzapcTjdVW LTqPu1+dmJLg7RGLpQY1rb5uzo5usvBxRMeacpK1vLWUtZjEAcXvXchUEs2loARCvC4Y IqBPOE3w0u2KcODikD+Metu+CUlFwDsA2rG1t6UbQ9aBbysbtOXdnxZAKdWEzIsZJbq0 QhnsH0e869Z5d4Z9CEJCvAD3F9vL7DxVoLjNfW6caG/qyZ9hoBRnrVx3/tL7asLnHz84 aznw== 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=jH+wEtoL7W9Zg7r4fiPJYe7IoteHZwvaweUMOmK14J8=; b=wxDjTZ/kErDKpGpP2Xe3AWKiH2FRHAENsLOvKrFqKs/8D4zTLvJvNXhz8xPEWXA5Oo /w3Gb6p4JgncBCAx+vPK8JaRazSn5F0/JUDDoc6AVc8V7nHt49QSZIN86P1fMJckumv5 lHNyQOJJbJ1pTQmKu43AwtVxkzopdYcC2YRZ7rQXs30vA6Mc6hb4MUTT+9nD3BJY9ppQ t5pcAScV/zOP25tV2ANj2z5GrpJCDPhyV2kS/kaLcsYK1ggKb5Esu+vOwdnLYlnCwVXY kzxCk+/oOxCoI3ZArlIN/tG14/wZEPPtkD0iY0ElMzILZOH94ue9CugeDKvky9r1SH18 Ac9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xg3kqQz9; 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=fail (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 jr1si3058858ejb.164.2020.10.28.02.13.05; Wed, 28 Oct 2020 02:13:27 -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=@kernel.org header.s=default header.b=xg3kqQz9; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S457859AbgJ0ORg (ORCPT + 99 others); Tue, 27 Oct 2020 10:17:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:35558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756539AbgJ0OOB (ORCPT ); Tue, 27 Oct 2020 10:14:01 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 87426206F7; Tue, 27 Oct 2020 14:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808041; bh=yuUPAauBzOJHRAHG0hIClVYymHiji0cjQl8wddwEQ/w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xg3kqQz9LdnLpsuyG4VQtCeqebJH0S+Bmn8LRsd9xZByzs1WbYn0gkmChURj4pT3j W8xeEBMS5ZPJbUjF+3ojND80Hu5zakbADC0IEZh9Y9o1voJNbMZuwb8Exw78yn02O6 JVsEdUTXiBtec+2QndCtl8ep9dm8nj03G0HtiWGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kaige Li , Jon Mason , Sasha Levin Subject: [PATCH 4.14 133/191] NTB: hw: amd: fix an issue about leak system resources Date: Tue, 27 Oct 2020 14:49:48 +0100 Message-Id: <20201027134916.096785931@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@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: Kaige Li [ Upstream commit 44a0a3c17919db1498cebb02ecf3cf4abc1ade7b ] The related system resources were not released when pci_set_dma_mask(), pci_set_consistent_dma_mask(), or pci_iomap() return error in the amd_ntb_init_pci() function. Add pci_release_regions() to fix it. Fixes: a1b3695820aa ("NTB: Add support for AMD PCI-Express Non-Transparent Bridge") Signed-off-by: Kaige Li Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- drivers/ntb/hw/amd/ntb_hw_amd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c index f0788aae05c9c..72a7981ef73fb 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -1032,6 +1032,7 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev, err_dma_mask: pci_clear_master(pdev); + pci_release_regions(pdev); err_pci_regions: pci_disable_device(pdev); err_pci_enable: -- 2.25.1