From nobody Mon Feb 9 04:45:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1680179907; cv=none; d=zohomail.com; s=zohoarc; b=HGPH1I43tSuSESEucv6Oy+TM3dqiX+82wfjLeVG+vr0wDLIjSu3s+ve2y8biZSk2ZvaLlT8CLZAlN8/SKp+FLhegWGj/YbgpY4pqYYonR9fNEHVDficpUv03n+MsFeduv06UQBzA1t+W8q0rElW4PT21Etp0+c5ufv71iqKhfKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680179907; h=Content-Type:Content-Transfer-Encoding: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=qI1Vey/ZYWwYC6sVp5lxDF97WsAwGCV0nqlfEfGBCSk=; b=jjI7dy7fBvzM13kJgFmzIJU59TasFz1dqSMroeS9SZWBDqaFY7xHevHCFSWWlqPlUTW0BRhDMjZvyuFs9UoSZeZ5FlbpZqbfGZhmhrSHxHYkugdvnFlxvvVwAHjriFXjqrIux4niJmWHdAg/l5v+z+88A2CWyeVCt6iuIkFVUII= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1680179907529216.9243115145922; Thu, 30 Mar 2023 05:38:27 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-458-9uh30JBGPyWq7H3h47X0KQ-1; Thu, 30 Mar 2023 08:38:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 73097857A93; Thu, 30 Mar 2023 12:38:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 598A24042AC6; Thu, 30 Mar 2023 12:38:20 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5F35719465BD; Thu, 30 Mar 2023 12:38:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 323961946587 for ; Thu, 30 Mar 2023 12:38:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 081A6C15BBA; Thu, 30 Mar 2023 12:38:18 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 849D3C15BA0 for ; Thu, 30 Mar 2023 12:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680179906; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qI1Vey/ZYWwYC6sVp5lxDF97WsAwGCV0nqlfEfGBCSk=; b=ZCjkLCD8cR252Z6hKp6Al5uHiVOTt3wXg3MZ9LipylAv6fa/kmbVo0oJ4qEwz99nBICVrB XKNNVaE8yyMqXQSdewXvOkMprafqOb1pYw24Qf3rwKhGtwHyFSbZ5s23CQquelCfQgm+Xr 4Aw7INDajAKxwonNSTlk3TI69bGBsio= X-MC-Unique: 9uh30JBGPyWq7H3h47X0KQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/3] conf: Clear pointer to freed bitmap holding hostdev's 'origstates' Date: Thu, 30 Mar 2023 14:38:13 +0200 Message-Id: <09dd31cb70012c42712470e79a03339d1850bf33.1680179855.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1680179909702100003 Content-Type: text/plain; charset="utf-8" 'virDomainHostdevDefClear' must clear the pointers too as it can be invoked multiple times on the same object e.g. inside qemuDomainRemoveHostDevice once via virDomainHostdevDefFree which skips freeing the object if it's used via and thus has a 'net' definition corresponding to it, and then subsequently via virDomainNetDefFree. Fix it by clearing the pointer along with freeing it. Fixes: d9e4075d4e9 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2182961 Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9f49c6e62d..08527964d1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3384,7 +3384,7 @@ void virDomainHostdevDefClear(virDomainHostdevDef *de= f) VIR_FREE(def->source.subsys.u.scsi_host.wwpn); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: - virBitmapFree(def->source.subsys.u.pci.origstates); + g_clear_pointer(&def->source.subsys.u.pci.origstates, virBitma= pFree); break; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: --=20 2.39.2