From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753154Ab1LTQIB (ORCPT ); Tue, 20 Dec 2011 11:08:01 -0500 Received: from sous-sol.org ([216.99.217.87]:60849 "EHLO sequoia.sous-sol.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751832Ab1LTQHy (ORCPT ); Tue, 20 Dec 2011 11:07:54 -0500 Date: Tue, 20 Dec 2011 08:07:30 -0800 From: Chris Wright To: "Hao, Xudong" Cc: "iommu@lists.linux-foundation.org" , "dwmw2@infradead.org" , "Zhang, Xiantao" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH] intel-iommu: Add device info into list before doing context mapping Message-ID: <20111220160730.GD30205@sequoia.sous-sol.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Hao, Xudong (xudong.hao@intel.com) wrote: > @@ -2282,6 +2276,14 @@ static int domain_add_dev_info(struct dmar_domain *domain, > pdev->dev.archdata.iommu = info; > spin_unlock_irqrestore(&device_domain_lock, flags); > > + ret = domain_context_mapping(domain, pdev, translation); > + if (ret) { > + list_del(&info->link); > + list_del(&info->global); At the very least, this is not correct locking. > + free_devinfo_mem(info); > + return ret; > + } > +