Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp21601imj; Fri, 8 Feb 2019 14:09:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IYMbwcGAjN4Zf5bq3NqMljpcGI3f7D2ZWMa9ELSI3kNgcGNZv+VKAsFqxh9f7ZzIr621xBD X-Received: by 2002:a17:902:2b8a:: with SMTP id l10mr23902476plb.70.1549663740687; Fri, 08 Feb 2019 14:09:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549663740; cv=none; d=google.com; s=arc-20160816; b=lRgw21kL3a1uHDMC3DJcmi+SuVVx+bvJ7ICxO0liGNYuMUrU5YK0pRrK7G7GzNx7e3 zZs/ciSaF2mOQISGgLB/Dy4zyNXxUuE6Ma5HVIwRoVlIAqyMB4szKHfobnZnbH+nn+88 vd9Xpp5/tVSjjjNYTqkOVleR1SOAMRRy/WHTHloiLD/IfGT2Hr7OmV9giYcAUX/vKts0 bVrDZ5rnPynkhU5wk/5QrNKaA6ot+0/LVo00phQAKa6OZbjhQGB4kbia2PL62OBVW3Rs Y8553a69i+J5sxQrvJogGdNaVYesarhYOzNqr6ESq0bRGtCzo+3EbgwV+SQRHfW0BTbI +dYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:dkim-signature; bh=GULhY35XoTlm5/PCGUwoxtR5PEJsxozVtiAVAUlJeRo=; b=Wn/njuIOPflrO1xQG3SOg014u7MBAcffTpkBUvKsm2xZb6Z4YQJoHNcQMPzv0u+U3q lYYnu7T3GX9R9ZcASy2YTpscw3TIa9+PVEs2ki/2K8sKisYqKMoUbGDhx0vJnKs2ksXm UzJJJxKbl4DVJUKPbA+grTXqP4mcQRbz5c1IR+UyRAZzOMxGsNLe+fIZnMIjH/H1fuCs qJkWQhqTDRlduR61slAwQ5ByqROL4sH6EZmL3fRiis0os8x6qT3s0AkEjg6azpg/jDWC X8x9NisLkXGRonnDz422u0MYgdxelZK6uvBgN7XtXFPV/eLFTzXQ23vKrMV89sb+zLlU 8TEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HXSw8Z5g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si3126445plk.328.2019.02.08.14.08.44; Fri, 08 Feb 2019 14:09:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=HXSw8Z5g; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727317AbfBHWGY (ORCPT + 99 others); Fri, 8 Feb 2019 17:06:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:54920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727301AbfBHWGY (ORCPT ); Fri, 8 Feb 2019 17:06:24 -0500 Received: from localhost (unknown [69.71.4.100]) (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 4EC9121908; Fri, 8 Feb 2019 22:06:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549663583; bh=LlL9qNuXyhnhjO0/gkCHpEfYioNA3elYCVyeib5vitg=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HXSw8Z5g6syIwOd1uQoVKHcl+kHFdi69fOM/ahm+ELlf0jCja7LNfU/7ZoK8i9mX6 fGlMkTKi0JJVoLWPorUkb78PstOghkXahKsehO4ZEgQXJz/3kIMT45fm+Rd+s7fUJ9 nQzxf19J8DevkJwez91gZnP2A780Wj98NK48pSus= Subject: [PATCH v1 6/7] iommu/vt-d: Remove misleading "domain 0" test from domain_exit() From: Bjorn Helgaas To: Joerg Roedel Cc: David Woodhouse , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Date: Fri, 08 Feb 2019 16:06:22 -0600 Message-ID: <154966358199.132359.6085600915087301558.stgit@bhelgaas-glaptop.roam.corp.google.com> In-Reply-To: <154966319813.132359.14641436497228395449.stgit@bhelgaas-glaptop.roam.corp.google.com> References: <154966319813.132359.14641436497228395449.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas The "Domain 0 is reserved, so dont process it" comment suggests that a NULL pointer corresponds to domain 0. I don't think that's true, and in any case, every caller supplies a non-NULL domain pointer that has already been dereferenced, so the test is unnecessary. Remove the test for a null "domain" pointer. No functional change intended. This null pointer check was added by 5e98c4b1d6e8 ("Allocation and free functions of virtual machine domain"). Signed-off-by: Bjorn Helgaas --- drivers/iommu/intel-iommu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 6e9f277bfd6d..b0860a8c48d4 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -1903,10 +1903,6 @@ static void domain_exit(struct dmar_domain *domain) { struct page *freelist; - /* Domain 0 is reserved, so dont process it */ - if (!domain) - return; - /* Remove associated devices and clear attached or cached domains */ rcu_read_lock(); domain_remove_dev_info(domain);