From patchwork Wed Feb 16 20:40:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 568411 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1GKfNb0030207 for ; Wed, 16 Feb 2011 20:41:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754377Ab1BPUlE (ORCPT ); Wed, 16 Feb 2011 15:41:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60247 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754280Ab1BPUlD (ORCPT ); Wed, 16 Feb 2011 15:41:03 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1GKe98m031984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Feb 2011 15:40:09 -0500 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1GKe8WX000944; Wed, 16 Feb 2011 15:40:08 -0500 From: Alex Williamson Subject: [PATCH v2 2/2] intel-iommu: Fix get_domain_for_dev() error path To: dwmw2@infradead.org, iommu@lists.linux-foundation.org Cc: alex.williamson@redhat.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, ddutile@redhat.com, chrisw@redhat.com Date: Wed, 16 Feb 2011 13:40:08 -0700 Message-ID: <20110216204005.2979.51224.stgit@s20.home> In-Reply-To: <20110216203204.2979.13203.stgit@s20.home> References: <20110216203204.2979.13203.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 16 Feb 2011 20:41:24 +0000 (UTC) diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index b670b06..b0343d1 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c @@ -1835,7 +1835,7 @@ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw) ret = iommu_attach_domain(domain, iommu); if (ret) { - domain_exit(domain); + free_domain_mem(domain); goto error; }