From nobody Thu Nov 13 06:06:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1578059416; cv=none; d=zohomail.com; s=zohoarc; b=Rt4EZeN+D89HHdhG0ayGQpfL+pasRYCPFZxrudR3ilg9VbdIRPTO+LjFgTO1YW58sp/5Q3TIknLxXtZcSo1Bc1fTXd2jAOvn9DGAdyaaLpeGRgh1l1MsS5RSuw1T8V83S+IEjh1R6lv/o8QlHleToiIdvnTeruI0BtTfbyLPeDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578059416; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Xvu09jGtvufRA4A6weFldh8HkDedZoxY5znVK4+Ecys=; b=CXet83peasz4w8hALT3Pq2/bGcZLR8SpBgGvIP28wIVVEz/rwBoQiqlkkyBGlNztNDDGMaKEbndh2rQdZ2SONV+yMScp5Cd3rs6qgZ3RwDYP2ir9gnplXwkop42mH3+40HH1hZ8Nf2YGmozDosM8GBNbc5zOXY14SKSUUvdMhcQ= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1578059416561432.4955832914285; Fri, 3 Jan 2020 05:50:16 -0800 (PST) Received: from localhost ([::1]:52510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inNLD-00019z-6L for importer@patchew.org; Fri, 03 Jan 2020 08:50:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48773) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1inNIX-0007Jf-Iy for qemu-devel@nongnu.org; Fri, 03 Jan 2020 08:47:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1inNIV-0001Vk-6H for qemu-devel@nongnu.org; Fri, 03 Jan 2020 08:47:28 -0500 Received: from mga03.intel.com ([134.134.136.65]:21927) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1inNIT-0001Nv-Jy for qemu-devel@nongnu.org; Fri, 03 Jan 2020 08:47:25 -0500 Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2020 05:47:15 -0800 Received: from iov2.bj.intel.com ([10.238.145.72]) by orsmga006.jf.intel.com with ESMTP; 03 Jan 2020 05:47:13 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,390,1571727600"; d="scan'208";a="221640112" From: Liu Yi L To: qemu-devel@nongnu.org, mst@redhat.com, pbonzini@redhat.com, peterx@redhat.com Subject: [PATCH v1 1/2] intel_iommu: a fix to vtd_find_as_from_bus_num() Date: Fri, 3 Jan 2020 21:28:05 +0800 Message-Id: <1578058086-4288-2-git-send-email-yi.l.liu@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578058086-4288-1-git-send-email-yi.l.liu@intel.com> References: <1578058086-4288-1-git-send-email-yi.l.liu@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.65 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kevin.tian@intel.com, Jacob Pan , Yi Sun , jun.j.tian@intel.com, yi.l.liu@intel.com, yi.y.sun@intel.co Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Ensure the return value of vtd_find_as_from_bus_num() is NULL by enforcing vtd_bus=3DNULL. This would help caller of vtd_find_as_from_bus_nu= m() to decide if any further operation on the returned vtd_bus. Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L Signed-off-by: Yi Sun --- hw/i386/intel_iommu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 43c94b9..00ebae4 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386/intel_iommu.c @@ -948,6 +948,7 @@ static VTDBus *vtd_find_as_from_bus_num(IntelIOMMUState= *s, uint8_t bus_num) return vtd_bus; } } + vtd_bus =3D NULL; } return vtd_bus; } --=20 2.7.4