From nobody Mon Apr 29 04:07:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150668295165066.7468446387121; Fri, 29 Sep 2017 04:02:31 -0700 (PDT) Received: from localhost ([::1]:34679 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxt3u-000885-Uq for importer@patchew.org; Fri, 29 Sep 2017 07:02:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxt2S-0007GX-AE for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxt2P-0001QS-FP for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:01:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55524) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxt2P-0001Pz-6F for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:00:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16F924E4D1 for ; Fri, 29 Sep 2017 11:00:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8F0618533; Fri, 29 Sep 2017 11:00:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0278B66; Fri, 29 Sep 2017 13:00:53 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 16F924E4D1 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 29 Sep 2017 13:00:50 +0200 Message-Id: <20170929110052.6111-2-kraxel@redhat.com> In-Reply-To: <20170929110052.6111-1-kraxel@redhat.com> References: <20170929110052.6111-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 29 Sep 2017 11:00:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/3] hw/usb/bus: Remove bad object_unparent() from usb_try_create_simple() X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth Valgrind detects an invalid read operation when hot-plugging of an USB device fails: $ valgrind x86_64-softmmu/qemu-system-x86_64 -device usb-ehci -nographic -S =3D=3D30598=3D=3D Memcheck, a memory error detector =3D=3D30598=3D=3D Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward = et al. =3D=3D30598=3D=3D Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyr= ight info =3D=3D30598=3D=3D Command: x86_64-softmmu/qemu-system-x86_64 -device usb-eh= ci -nographic -S =3D=3D30598=3D=3D QEMU 2.10.50 monitor - type 'help' for more information (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet (qemu) device_add usb-tablet =3D=3D30598=3D=3D Invalid read of size 8 =3D=3D30598=3D=3D at 0x60EF50: object_unparent (object.c:445) =3D=3D30598=3D=3D by 0x580F0D: usb_try_create_simple (bus.c:346) =3D=3D30598=3D=3D by 0x581BEB: usb_claim_port (bus.c:451) =3D=3D30598=3D=3D by 0x582310: usb_qdev_realize (bus.c:257) =3D=3D30598=3D=3D by 0x4CB399: device_set_realized (qdev.c:914) =3D=3D30598=3D=3D by 0x60E26D: property_set_bool (object.c:1886) =3D=3D30598=3D=3D by 0x61235E: object_property_set_qobject (qom-qobject.= c:27) =3D=3D30598=3D=3D by 0x61000F: object_property_set_bool (object.c:1162) =3D=3D30598=3D=3D by 0x4567C3: qdev_device_add (qdev-monitor.c:630) =3D=3D30598=3D=3D by 0x456D52: qmp_device_add (qdev-monitor.c:807) =3D=3D30598=3D=3D by 0x470A99: hmp_device_add (hmp.c:1933) =3D=3D30598=3D=3D by 0x3679C3: handle_hmp_command (monitor.c:3123) The object_unparent() here is not necessary anymore since commit 69382d8b3e8600b3 ("qdev: Fix object reference leak in case device.realize() fails"), so let's remove it now. Suggested-by: Paolo Bonzini Signed-off-by: Thomas Huth Message-id: 1506526106-30971-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/bus.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/usb/bus.c b/hw/usb/bus.c index d910f849e7..e56dc3348a 100644 --- a/hw/usb/bus.c +++ b/hw/usb/bus.c @@ -341,9 +341,7 @@ static USBDevice *usb_try_create_simple(USBBus *bus, co= nst char *name, object_property_set_bool(OBJECT(dev), true, "realized", &err); if (err) { error_propagate(errp, err); - error_prepend(errp, "Failed to initialize USB device '%s': ", - name); - object_unparent(OBJECT(dev)); + error_prepend(errp, "Failed to initialize USB device '%s': ", name= ); return NULL; } return dev; --=20 2.9.3 From nobody Mon Apr 29 04:07:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506682954169121.02957204968652; Fri, 29 Sep 2017 04:02:34 -0700 (PDT) Received: from localhost ([::1]:34680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxt3t-00088N-V0 for importer@patchew.org; Fri, 29 Sep 2017 07:02:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxt2S-0007GW-9k for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxt2P-0001QF-8D for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:01:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35618) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxt2P-0001Px-2K for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:00:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1E07285C8; Fri, 29 Sep 2017 11:00:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8F3A1853B; Fri, 29 Sep 2017 11:00:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1324031EB7; Fri, 29 Sep 2017 13:00:53 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F1E07285C8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 29 Sep 2017 13:00:51 +0200 Message-Id: <20170929110052.6111-3-kraxel@redhat.com> In-Reply-To: <20170929110052.6111-1-kraxel@redhat.com> References: <20170929110052.6111-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 29 Sep 2017 11:00:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/3] usb: fix libusb config variable name. X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kiszka , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Cc: Jan Kiszka Fixes: 4e5ee5b21c84fe3023a64b5cc2e12a52ab0597c1 Signed-off-by: Gerd Hoffmann Tested-by: Jan Kiszka Message-id: 20170926063820.30773-1-kraxel@redhat.com --- hw/usb/Makefile.objs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/Makefile.objs b/hw/usb/Makefile.objs index 9255234c63..0e6d54b21f 100644 --- a/hw/usb/Makefile.objs +++ b/hw/usb/Makefile.objs @@ -42,7 +42,7 @@ redirect.o-cflags =3D $(USB_REDIR_CFLAGS) redirect.o-libs =3D $(USB_REDIR_LIBS) =20 # usb pass-through -ifeq ($(CONFIG_LIBUSB)$(CONFIG_USB),yy) +ifeq ($(CONFIG_USB_LIBUSB)$(CONFIG_USB),yy) common-obj-y +=3D host-libusb.o host-legacy.o else common-obj-y +=3D host-stub.o --=20 2.9.3 From nobody Mon Apr 29 04:07:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506682962742174.23597343543327; Fri, 29 Sep 2017 04:02:42 -0700 (PDT) Received: from localhost ([::1]:34681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxt43-0008Ga-SU for importer@patchew.org; Fri, 29 Sep 2017 07:02:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dxt2V-0007IP-Pz for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:01:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dxt2Q-0001Qo-4Y for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:01:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55576) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dxt2P-0001QN-VJ for qemu-devel@nongnu.org; Fri, 29 Sep 2017 07:00:58 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E42764ACA7 for ; Fri, 29 Sep 2017 11:00:56 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id D906E18B61; Fri, 29 Sep 2017 11:00:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1A23B3F136; Fri, 29 Sep 2017 13:00:53 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E42764ACA7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 29 Sep 2017 13:00:52 +0200 Message-Id: <20170929110052.6111-4-kraxel@redhat.com> In-Reply-To: <20170929110052.6111-1-kraxel@redhat.com> References: <20170929110052.6111-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 29 Sep 2017 11:00:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/3] usb: Use angle brackets for cacard include directive X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Fam Zheng This is a library header, so angle brackets are more appropriate; also move the line to before QEMU headers, as is recommended in HACKING. Signed-off-by: Fam Zheng Message-id: 20170920085952.3872-1-famz@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/ccid-card-passthru.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c index 45d96b03c6..117711862e 100644 --- a/hw/usb/ccid-card-passthru.c +++ b/hw/usb/ccid-card-passthru.c @@ -9,11 +9,11 @@ */ =20 #include "qemu/osdep.h" +#include #include "chardev/char-fe.h" #include "qemu/error-report.h" #include "qemu/sockets.h" #include "ccid.h" -#include "cacard/vscard_common.h" =20 #define DPRINTF(card, lvl, fmt, ...) \ do { \ --=20 2.9.3