Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp465829pxx; Wed, 28 Oct 2020 08:59:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9QgLlZ/rByvU/zMrDAaQ29WZrqoPMJPAbs++oGOQBtznmmskH3qPKbbxjLhVyGbB4ICGA X-Received: by 2002:a17:906:7157:: with SMTP id z23mr8511743ejj.474.1603900760713; Wed, 28 Oct 2020 08:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603900760; cv=none; d=google.com; s=arc-20160816; b=w7yUBzBHvCNP1AIG0NeUrLKnUCii+ek2r8AltMsIq/97ipM4Jz0muxpG1YvYjfp7Js iO8nu3kHoxTj5Ta+ywfi757JUe0JPZFvFghPj1aOXfe1VFGtonF02tilDrHqowR1F/Au 3F+CSk9FLcEKCtD1BT9gppihapebrc2LNrKK3lMywi6SOpFiQCcjUMn8EpdbFXyYdN4c 9yZGYzkJZrtCTGrAK/BjM/2h3NqF6zDqSAJjJ+PMs0ro18jRKK968VHI2/VNA8+90EnG xRy2FRmQjhzJ+8NDxVd/hljqfQg+Z5pOjhqG3bSNYrhwuoIyJt7NvwCimWMrtcnHq0Ds TakQ== 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=RqmNWDbtoMd9bMXEbUe3IArLXF1UJydMx3BDYtoO//I=; b=wF+0IlDHdklr9yEgqFEo2dKgDaa9FK9X0sFhM4p7G48Ke1Rw6sbcHM3x/TNzyNRgB9 7Z1a6r18VdHPrcULOUWb2lpZCJvBuI5QhO55HT/YkfGgqUgfaomd/GPSR71wyJ9yA1EA QnLJ0eH5Rx5+n8aHs3Fx3MvTMrNhSQiFRnNHafsTOssKv8AW1uTcRjdINnclmCC1RRJv /kSjmZY+xcMXa412Gz2SbvE4xIXUz40jZfxTdSzRNFWQGqLzCRR3tYxCxc/xURAx4j3H gBGD7iWIDTN8xX8xzpnJe6p1X8YTX4ikJGeoABoZwLIH1HRKIPkQNlogdqtR0evEMGcJ M20g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OGoQzDZY; 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 bs17si3022913ejb.543.2020.10.28.08.58.59; Wed, 28 Oct 2020 08:59:20 -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=OGoQzDZY; 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 S1813750AbgJ0QyX (ORCPT + 99 others); Tue, 27 Oct 2020 12:54:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:47984 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794470AbgJ0PL7 (ORCPT ); Tue, 27 Oct 2020 11:11:59 -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 1317B20657; Tue, 27 Oct 2020 15:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811517; bh=ujQ6vsxZv7Yrxs8alK/iqSq46uuwkkVKfdjy/gvsfzk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OGoQzDZY9r9DIIFFk4zvbGiKN+0ANx5un4nw5XiJmk1GN1GHJm72S5eMqX6KfgghE 4TN0CtZVt18HcKAexL2iRVamGbCxs5gM2wV4/LeWgMzppwkHgBWKQBLlzHcMgRf/73 5X42xo8Oi4W5iWNSqzcLgHh7LRsEJPPE7sWIkgQA= 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 5.8 522/633] NTB: hw: amd: fix an issue about leak system resources Date: Tue, 27 Oct 2020 14:54:25 +0100 Message-Id: <20201027135547.254055621@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 88e1db65be02c..71428d8cbcfc5 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -1203,6 +1203,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