From nobody Wed May 1 01:09:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529072538906923.7260708258466; Fri, 15 Jun 2018 07:22:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A2350356E4; Fri, 15 Jun 2018 14:22:13 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2362C30A6C23; Fri, 15 Jun 2018 14:22:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 4BE19180BACA; Fri, 15 Jun 2018 14:22:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5FEKkfD009050 for ; Fri, 15 Jun 2018 10:20:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1AC1163A4F; Fri, 15 Jun 2018 14:20:46 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEDBD6352E for ; Fri, 15 Jun 2018 14:20:43 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Fri, 15 Jun 2018 16:20:41 +0200 Message-Id: <25a36b1244d6e536235d32f130ead75b5a6c034b.1529072434.git.mprivozn@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemuDomainDetachDeviceConfig: Don't free device from @dev X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 15 Jun 2018 14:22:15 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1591561 For reasons I don't understand my original patch of 75f0fd51124 freed not only the chardev from domain but also the one from passed virDomainDeviceDefPtr. This caused no troubles until now, because those two pointers were separate, but after I've introduced virDomainDetachDeviceAlias() they became the same resulting in double free on detach. Signed-off-by: Michal Privoznik Reviewed-by: J=EF=BF=BDn Tomko --- src/qemu/qemu_driver.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 42069ee617..7fe86d4d2e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -8241,8 +8241,6 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, return -1; =20 virDomainChrDefFree(chr); - virDomainChrDefFree(dev->data.chr); - dev->data.chr =3D NULL; break; =20 case VIR_DOMAIN_DEVICE_FS: --=20 2.16.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list