From nobody Wed Nov 12 23:04:28 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=1574671585; cv=none; d=zohomail.com; s=zohoarc; b=ZKs2dgoL3vRfQWBDj274ypQ6LczGhlbb8BF89uNFog+nnvG8OdFSSpcZXwFvt4nu7tQ2F9GnkvSFAAwXg0bVM+OXOn3gOiMuPThC8hVBq7QV+xLq2pKVmYiur5/ArZPIkBgGKEoa95nsliYez+BJXIoN8GUOWgb/sk/Uhu9ZGFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574671585; 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=D69oNG7b0azwE9NFjTWHIQsylubZZHajetVSBheyyWc=; b=hx+E/s/gMpFtIM+8qqavaiGSOtdFwNTqVU2ByekxLx8GkehrzWnPI6WndCuc9faZQCR8+fdS/bqNQKSbMbZ39/CBXbOqzymYeI20/7V1U6TFX1atPM/AMIOqUqGdOVOuG1tP2NBCSgSKwjM01DcXUGpdH9P4+ty42yM9NL6Jcog= 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 1574671585481194.34474605391938; Mon, 25 Nov 2019 00:46:25 -0800 (PST) Received: from localhost ([::1]:41395 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZA0m-0007VX-1i for importer@patchew.org; Mon, 25 Nov 2019 03:46:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52780) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZ9z8-00064B-S0 for qemu-devel@nongnu.org; Mon, 25 Nov 2019 03:44:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZ9z7-0004nT-Uc for qemu-devel@nongnu.org; Mon, 25 Nov 2019 03:44:42 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:58126 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iZ9z6-0004mQ-0t for qemu-devel@nongnu.org; Mon, 25 Nov 2019 03:44:40 -0500 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-NCLrlL27NnyF4sVbR3-5Lw-1; Mon, 25 Nov 2019 03:44:37 -0500 Received: by mail-qt1-f198.google.com with SMTP id x8so7998946qtq.14 for ; Mon, 25 Nov 2019 00:44:37 -0800 (PST) Received: from redhat.com (bzq-79-176-6-42.red.bezeqint.net. [79.176.6.42]) by smtp.gmail.com with ESMTPSA id d15sm3001307qke.55.2019.11.25.00.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Nov 2019 00:44:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574671478; 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=D69oNG7b0azwE9NFjTWHIQsylubZZHajetVSBheyyWc=; b=AbqDpJHYzLU0geamFXW0vJXLampvnkI/PoE/pYgOlvOYSmbPDlChk+muzRGv6oEb+rLPes P9WymTcllhEOO+pX9pc2CrhGqp65lF1S3jV31Ow9B08+gG7DKDS6GQ8+lVt//SebR2S8f0 0vV3MfKP7KZ5Lpll41944B5sXlmfPUc= 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:content-transfer-encoding :in-reply-to; bh=LqCPiJ37mcVI0DJ8LVWFFDKGbwhqfFvRE/VI24d69sc=; b=gIxC7hJpmpeAg99f4y7kWI/Uj/ndLKrJrTuVHG4IBKJZGe7SwQQMgpNrUi41oBRJ5X 0wGTxU38SlyDL7BK3Itpb05zsn9pFgxU8/qtQ0/5Ym27JmIsC2t6x0iyqnMKTWB+C57D 6Msd5+8PKuj/Qww7MgpiqOLZPweFYjNWaSS+KfAhMmzh87YHMS7qeRYyZqnCcenLeQ/R JImhygyUVkn5DjxLi9nOIBinYZ99lkqAZsDmmnsSJr/PkaWNi7/H8HUhon3Hhd+bKvnV EWwQlJ0evFv7KbxtBzNzXaN+Vvv/rfic7UnkW2X+YlXKRrLx8meLYw0XJlazwp3SDXcO Plhw== X-Gm-Message-State: APjAAAX/vSWenrn8fjsY98Fu6bMn3Bm8ajzYp1V/D22zy+4xr0ydwLY0 zo9n6+eFtkagubgChtbB4HXX7EXQYuKVR2tOGOjuMUmMHzXkvEpHgb+qn0s3EGKREcJ3a1v2vwj +dZYPDWf1WVq/Lw0= X-Received: by 2002:ac8:27e2:: with SMTP id x31mr16941068qtx.342.1574671476444; Mon, 25 Nov 2019 00:44:36 -0800 (PST) X-Google-Smtp-Source: APXvYqy7m1s+m0U63qWc/BKyrL88SxlZHAGjfu6aL398l73BeryZSE7oLx9pdAQvmShVSaMi5T+ONg== X-Received: by 2002:ac8:27e2:: with SMTP id x31mr16941057qtx.342.1574671476282; Mon, 25 Nov 2019 00:44:36 -0800 (PST) Date: Mon, 25 Nov 2019 03:44:32 -0500 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 1/3] virtio-input: fix memory leak on unrealize Message-ID: <20191125084403.324866-2-mst@redhat.com> References: <20191125084403.324866-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20191125084403.324866-1-mst@redhat.com> X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent X-MC-Unique: NCLrlL27NnyF4sVbR3-5Lw-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: 205.139.110.120 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 , Gerd Hoffmann , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau 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: Marc-Andr=C3=A9 Lureau Spotted by ASAN + minor stylistic change. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Michael S. Tsirkin Message-Id: <20191121095649.25453-1-marcandre.lureau@redhat.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Michael S. Tsirkin --- hw/input/virtio-input.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c index 51617a5885..ec54e46ad6 100644 --- a/hw/input/virtio-input.c +++ b/hw/input/virtio-input.c @@ -275,6 +275,7 @@ static void virtio_input_finalize(Object *obj) =20 g_free(vinput->queue); } + static void virtio_input_device_unrealize(DeviceState *dev, Error **errp) { VirtIOInputClass *vic =3D VIRTIO_INPUT_GET_CLASS(dev); @@ -288,6 +289,8 @@ static void virtio_input_device_unrealize(DeviceState *= dev, Error **errp) return; } } + virtio_del_queue(vdev, 0); + virtio_del_queue(vdev, 1); virtio_cleanup(vdev); } =20 --=20 MST