From nobody Thu Nov 13 06:04:09 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; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1578230708; cv=none; d=zohomail.com; s=zohoarc; b=cy5jsPkWRBSh0VbOfZdnAZSn9/YlXxsSs1gVs6GgZmEP1rW0EI7k0ktVy6TP/brjO869ZGZvwlzIdCIDVTuT+7t5Pr0z+WTLJAY0htRJ35E4W5qNus+L8fdVw1gfPWDxwEbT4xIujDetzbvTZGyPY2OBqHeQLpnTM1E7dnOS7jk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578230708; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s9CW2f1wTLCUXOOV0nNq1e86u0ryEb/Y8cd2jez9DrU=; b=gMKlb/5x++UB0nS01PS73MudIkSS/V67ZkWTrwlKAt5Z4StCnXX11W+YJrckGEs1v31UruxgnvmZRh+qet98uagn1KxcXT7KkggJqyeK3satG8237DmL8NTkZhEIWkUUiM2kwMc30GcZJtjw9dDOBMAIMYnaGiGGHWkVewHJCi8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1578230708247783.4237613944804; Sun, 5 Jan 2020 05:25:08 -0800 (PST) Received: from localhost ([::1]:42234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io5tz-0007Of-4X for importer@patchew.org; Sun, 05 Jan 2020 08:25:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58720) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1io5Vu-0003yb-LE for qemu-devel@nongnu.org; Sun, 05 Jan 2020 08:00:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1io5Vt-0005Ru-EF for qemu-devel@nongnu.org; Sun, 05 Jan 2020 08:00:14 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:50057 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1io5Vt-0005Rd-AN for qemu-devel@nongnu.org; Sun, 05 Jan 2020 08:00:13 -0500 Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-369-CFWs4czvNCC8Nve4bMLopg-1; Sun, 05 Jan 2020 08:00:07 -0500 Received: by mail-qt1-f199.google.com with SMTP id e37so32589460qtk.7 for ; Sun, 05 Jan 2020 05:00:06 -0800 (PST) Received: from redhat.com (bzq-79-183-34-164.red.bezeqint.net. [79.183.34.164]) by smtp.gmail.com with ESMTPSA id y18sm19181850qki.0.2020.01.05.05.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2020 05:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578229212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=s9CW2f1wTLCUXOOV0nNq1e86u0ryEb/Y8cd2jez9DrU=; b=adeg4H9fCNd9GFf5q42EKg/OdcN3yfY4muJAHf1zG2nH9aBrKbN3T6KzfMaAapjasStNAR BEQFtc2IB8ojB1KJ5HFtstxtCSc7EqkPth//Qrv0TG68jw15Dwi+B5EuExaggDRKEsRRqL xmECrj0p67djJMaaR6DhyHd90hjrgKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pNIx/NiIdCE26OJhITv4+Fn8KZTuaXrKqh88qEn+vzc=; b=rCzX4CMQjz8gu9qd8R/tLwXsI/TI0z/07Z5WYu/xpBBB5dpQRZHXmQ/zuTT5L4nwWM Zvf/wFlgZWSvu/zPrN42jKZdtPWUK/82m1E1BKcC8p+RV+6NQppvXcFC66HieAfIFc0S iW0Jeo7IFKu1K4uyaUKdCfJ7xNbV5o+Axt40RRi+wzf0iqCoxmjlAKnIey6Htzm6GBIT h3sBclruYPfVHvLfSLLsi+cX+VIkcGTIFBM4AWFiuTw8kt7pTZas2beOG2hJ8mfFiX+n AMbcw6uxxI8DJBI8kd6czAaYEjKFeAof4j/SUR2eB8+8rN5zi8S2cCFnDK6AFuHcTRye Vv7g== X-Gm-Message-State: APjAAAXB+mXXr6n/m6w0Hstz0yjgggQWdU604mu4GA+/mgqfQnKN7o7Y kRmJ4bJh4Oz85VNK+sp5iaGmlqXBzzblZyyoFT/QXktU7KhvxAthPY2MScAPlEKk83aHYETvT1u qOyRYMzym3VzLtb4= X-Received: by 2002:aed:2a87:: with SMTP id t7mr59400344qtd.384.1578229205355; Sun, 05 Jan 2020 05:00:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwzmhbBoRU0CKNJ7Jwdq4kaoke+znnw9ZVMiFTafmdUCOiILtGzMv9d8B6A27Lcb5YPRoeVeA== X-Received: by 2002:aed:2a87:: with SMTP id t7mr59400328qtd.384.1578229205200; Sun, 05 Jan 2020 05:00:05 -0800 (PST) Date: Sun, 5 Jan 2020 07:59:59 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL v3 31/32] intel_iommu: a fix to vtd_find_as_from_bus_num() Message-ID: <20200105125622.27231-32-mst@redhat.com> References: <20200105125622.27231-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200105125622.27231-1-mst@redhat.com> X-Mailer: git-send-email 2.24.1.751.gd10ce2899c X-Mutt-Fcc: =sent X-MC-Unique: CFWs4czvNCC8Nve4bMLopg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: Peter Maydell , Kevin Tian , Jacob Pan , Yi Sun , Eduardo Habkost , qemu-stable@nongnu.org, Peter Xu , Liu Yi L , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Liu Yi L 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: qemu-stable@nongnu.org Cc: Kevin Tian Cc: Jacob Pan Cc: Peter Xu Cc: Yi Sun Signed-off-by: Liu Yi L Signed-off-by: Yi Sun Message-Id: <1578058086-4288-2-git-send-email-yi.l.liu@intel.com> Reviewed-by: Peter Xu Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- 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 ee06993675..609b80750a 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 MST