From nobody Fri Nov 14 05:12:24 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=1584963156; cv=none; d=zohomail.com; s=zohoarc; b=Ixf+TKcRlFWFctl/0amOxaHFvT8Au8wa5ZWtZrGTlhmzdhALEBebDAchEFRnAsO0Czyq+SWHpOpGG53s9DVsOODnmKfuu6SAmTZgd7WZl8BKsO/hhlldUbri7ccntHJ7Ku9FebQ1UUDxywvsPDMfo5yasxZ3GZkIn8pRBA1A/C0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584963156; 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=CnY3zLI4QPJwJbV3E83s5quIe0UqJksgPfBVqujwwYQ=; b=bDXxrnLurh49lAnPdYvwOCqkIKaKxWIAFqjt9EE9UoOHhAhQiwilaDRBnxLgmOzl7sJx5LSaqSgNyQuQM7TGxr/AFE2RHHDCOpsvJc3Q0kzTViY8U8Fsm59MWesdUWsuXGS1PIo0WqmVrzcWez1e3H7kU08X1mCnJo+wwtJFOZs= 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 15849631559981008.201271659972; Mon, 23 Mar 2020 04:32:35 -0700 (PDT) Received: from localhost ([::1]:60488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGLJq-0000eI-Ox for importer@patchew.org; Mon, 23 Mar 2020 07:32:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42623) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGLHH-000633-SI for qemu-devel@nongnu.org; Mon, 23 Mar 2020 07:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGLHG-0005oP-Oj for qemu-devel@nongnu.org; Mon, 23 Mar 2020 07:29:55 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:27777) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jGLHG-0005oA-Lj for qemu-devel@nongnu.org; Mon, 23 Mar 2020 07:29:54 -0400 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-4gLPi4zqOFieM-ye2pmKgg-1; Mon, 23 Mar 2020 07:29:52 -0400 Received: by mail-wm1-f70.google.com with SMTP id x23so557976wmj.1 for ; Mon, 23 Mar 2020 04:29:52 -0700 (PDT) Received: from localhost.localdomain (37.red-83-52-54.dynamicip.rima-tde.net. [83.52.54.37]) by smtp.gmail.com with ESMTPSA id 9sm3933672wmm.6.2020.03.23.04.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 04:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584962994; 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=CnY3zLI4QPJwJbV3E83s5quIe0UqJksgPfBVqujwwYQ=; b=JxMdLQKD3RurIf1ttp5UO1h2Pcgg2hjsT4AKC9pbkfeUVkZfXnO3JFUy1OzCy2APDBG0Nt WIZmM+/vChjNCwjyjf7qpbO5Rz2Y1eDfuvpiRHmp46qO6KNreIfA8tAtr7aWSuk+N21OQx rZZWuK2D8mXuCGgWIJkvMyUTmFKNv8M= X-MC-Unique: 4gLPi4zqOFieM-ye2pmKgg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7K6WQY9fcdbigH9iiFUH1LhMVHv2gz9dk5QjDw4BfrU=; b=pIkvnTEgNEfts8lM45Xyy0j1AkSSu02OoAZ/3k0LaV0MixNvrIxXAsZnehEXesURFK kRVwSxkMTaGMHFP3is10IqNwsK/oTNFq9t3PbNBgc1xIko21Cs/i3tH57BDKcohq3wX/ aMlcV7BeAlhR2/vXbgQLMGadZTLiCNE3IGddDML8sTbXFDHG4niJ+w/Bq1OM1Ps/4yx/ Wsx7GVngWx8fUmWhtFiV/Z0ogjtEkPW4fBSK3VqJ8co0FOYI0Jc3R53h7UgIq6af7M2u cUY87YnPEBXwITSPfogfbXt3jkH/3HUOFDud8JJIfK6cT+KXB+ZzJhhi3DfhGreRsEpM CO6Q== X-Gm-Message-State: ANhLgQ2d7F42aAp8dFpxu9YKq70KyM7+ez02F971Ta9E2OIPYBOi2cRZ OhKgVUXO4NH/PItEanHxOtYEyC6B5RGFs8hSIBqHNkF0ihaC68JWg41to5LnoHXDd4ngkxODDic E/y2YyF+D+LQmtUw= X-Received: by 2002:adf:914e:: with SMTP id j72mr29812390wrj.109.1584962991021; Mon, 23 Mar 2020 04:29:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vslTSQ7xCR9n4plBG+WaLw6Q8/AzFaXYp9f+feH0KgjDbZvibAWYKH/15acs06uPXO6qtyZCQ== X-Received: by 2002:adf:914e:: with SMTP id j72mr29812363wrj.109.1584962990781; Mon, 23 Mar 2020 04:29:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH-for-5.0 1/3] vhost-user-gpu: Release memory returned by vu_queue_pop() with free() Date: Mon, 23 Mar 2020 12:29:41 +0100 Message-Id: <20200323112943.12010-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200323112943.12010-1-philmd@redhat.com> References: <20200323112943.12010-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 63.128.21.74 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 , "Michael S. Tsirkin" , qemu-stable@nongnu.org, Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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"; text/plain; charset="utf-8" vu_queue_pop() returns memory that must be freed with free(). Cc: qemu-stable@nongnu.org Reported-by: Coverity (CID 1421887 ALLOC_FREE_MISMATCH) Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marc-Andr=C3=A9 Lureau --- contrib/vhost-user-gpu/vhost-user-gpu.c | 4 ++-- contrib/vhost-user-gpu/virgl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-g= pu/vhost-user-gpu.c index b45d2019b4..a019d0a9ac 100644 --- a/contrib/vhost-user-gpu/vhost-user-gpu.c +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c @@ -848,7 +848,7 @@ vg_handle_ctrl(VuDev *dev, int qidx) QTAILQ_INSERT_TAIL(&vg->fenceq, cmd, next); vg->inflight++; } else { - g_free(cmd); + free(cmd); } } } @@ -939,7 +939,7 @@ vg_handle_cursor(VuDev *dev, int qidx) } vu_queue_push(dev, vq, elem, 0); vu_queue_notify(dev, vq); - g_free(elem); + free(elem); } } =20 diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c index 43413e29df..b0bc22c3c1 100644 --- a/contrib/vhost-user-gpu/virgl.c +++ b/contrib/vhost-user-gpu/virgl.c @@ -519,7 +519,7 @@ virgl_write_fence(void *opaque, uint32_t fence) g_debug("FENCE %" PRIu64, cmd->cmd_hdr.fence_id); vg_ctrl_response_nodata(g, cmd, VIRTIO_GPU_RESP_OK_NODATA); QTAILQ_REMOVE(&g->fenceq, cmd, next); - g_free(cmd); + free(cmd); g->inflight--; } } --=20 2.21.1