From patchwork Sat Oct 26 19:39:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1184841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 470rtc2Xsqz9sPL for ; Sun, 27 Oct 2019 06:40:40 +1100 (AEDT) Received: from localhost ([::1]:41642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iORvR-0000qd-BY for incoming@patchwork.ozlabs.org; Sat, 26 Oct 2019 15:40:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50985) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iORuR-0000mq-6A for qemu-devel@nongnu.org; Sat, 26 Oct 2019 15:39:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iORuP-0000B5-TB for qemu-devel@nongnu.org; Sat, 26 Oct 2019 15:39:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38332) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iORuP-0000Av-My for qemu-devel@nongnu.org; Sat, 26 Oct 2019 15:39:33 -0400 Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DC12D80F6D for ; Sat, 26 Oct 2019 19:39:32 +0000 (UTC) Received: by mail-qt1-f197.google.com with SMTP id i25so6314894qtm.17 for ; Sat, 26 Oct 2019 12:39:32 -0700 (PDT) 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=VjvBlMoTKwLGMX9SWGSd6Z2eE4BOtsqncgN0gdyFP+8=; b=NBlB72Ln+J1NW5NvZBmIFwCgFZBb3KugAFnne5PWCSegU2cGMyUJJnjJA6o5VKwuS3 lp1NMM8mtFYjMW43SdRyraC9u+ziAR8Hc/mSdYX1aDH/o6Qe62wv6IMwZTsvn5oeWmbl RCHFnU7DOQdYPmvMZSil+TlMazK6Zrn1lKX3uxE5bTUNXkHY+ZkJuO+0MioM7JyJFi3X l+V7cwj0cKnzL6kPZp7YTPPoCWVNx0ex8LytWhsthEntELY8j2yfoIRFoXaUcr/U1whS yltuTm59lhRBU3sVtW/XiPg6MmCpC4sn4fiS4iE5dTzd2f+KAMTKmsc/ptBGQRTby2ru E5tw== X-Gm-Message-State: APjAAAWofX3Zr3CTOuqLcnJiM8eex1TLCs7knynX9AzMCGA6z2Iz6WKJ uVmli8AkvWqBMf3CJ0xBXNtZO3ezpZFjq3jsoK6Vsn6+pcKhtmGZyiyYy4ZzrHjvNpk3ekMn1dK Z7Vm/1ACvTrZzsxc= X-Received: by 2002:a05:6214:4d:: with SMTP id c13mr9668920qvr.116.1572118771828; Sat, 26 Oct 2019 12:39:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqx6wqLiKA5A17StVA84YfBdWo21UuEFuuOM9+EUtn1P0kxSYyQXM+OEeJoeotvdqaOb7gJ6tw== X-Received: by 2002:a05:6214:4d:: with SMTP id c13mr9668911qvr.116.1572118771633; Sat, 26 Oct 2019 12:39:31 -0700 (PDT) Received: from redhat.com (bzq-79-176-10-77.red.bezeqint.net. [79.176.10.77]) by smtp.gmail.com with ESMTPSA id n65sm3556435qkb.19.2019.10.26.12.39.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Oct 2019 12:39:30 -0700 (PDT) Date: Sat, 26 Oct 2019 15:39:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Subject: [PULL 04/25] virtio: Free rnd virqueue at unrealize() Message-ID: <20191026193824.11926-5-mst@redhat.com> References: <20191026193824.11926-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191026193824.11926-1-mst@redhat.com> X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Laurent Vivier , Peter Maydell , Amit Shah , Eugenio =?utf-8?b?UMOpcmV6?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Eugenio Pérez The function virtio_del_queue was not called at unrealize() callback. This was detected due to add an allocated element on the vq introduce in future commits (used_elems) and running address sanitizer memory leak detector. Signed-off-by: Eugenio Pérez Message-Id: <20191025083527.30803-5-eperezma@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio-rng.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c index e93bed020f..b498a20332 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c @@ -238,6 +238,7 @@ static void virtio_rng_device_unrealize(DeviceState *dev, Error **errp) qemu_del_vm_change_state_handler(vrng->vmstate); timer_del(vrng->rate_limit_timer); timer_free(vrng->rate_limit_timer); + virtio_del_queue(vdev, 0); virtio_cleanup(vdev); }