From patchwork Thu Feb 28 16:46:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aarushi Mehta X-Patchwork-Id: 10833441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DFC71880 for ; Thu, 28 Feb 2019 16:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 858F028AD7 for ; Thu, 28 Feb 2019 16:47:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7690629653; Thu, 28 Feb 2019 16:47:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3012E28AD7 for ; Thu, 28 Feb 2019 16:47:54 +0000 (UTC) Received: from localhost ([127.0.0.1]:42825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzOqe-0001qB-Vd for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Feb 2019 11:47:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzOpx-0001Vx-L7 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 11:47:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzOpv-0002Sb-45 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 11:47:09 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:36505) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzOpu-0002Rz-OO; Thu, 28 Feb 2019 11:47:06 -0500 Received: by mail-pf1-x442.google.com with SMTP id n22so9992055pfa.3; Thu, 28 Feb 2019 08:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=zLu66D0uwzClyJYR/h/ld+mnIYFUWkCBfsq2ybFqzY0=; b=mi//3nTZrX926QdWwMNKznDGeLRc1jVBnYnluFhVoWddN9DobEq7g4CguDpEk60/R9 6JfWmiSlkeZ+a+r9SLPz8AaX9I2CfmTjbUsl8LFz9ZiAoytWtxglrwXBrk+s42tvnosb RBulAEb8Vcw3JJhRviEybNZfP8Iknt5y8SHOk+e6wKVjaEeEdKTlNnF5UtfOMGggwjc0 wg8d12ThU1bxZq2xRs5OT9mNQGxo0QuD3D8kxT50oOlQH/D79YQflwieIe60SnuKyCCZ Ia2dtsn3AS8NA3QDQP7wqqd7LVnvTPgXrjfujGGZ747jBDQRWffPcy/VA5CajajlSmub 0sgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:mime-version :content-transfer-encoding; bh=zLu66D0uwzClyJYR/h/ld+mnIYFUWkCBfsq2ybFqzY0=; b=K5m+9JZBCHk/8FwnWCWqHQ06daP504lpE/BEwmLwewyh/OnUobv2V7kixY22fGtfDi JJ6aiKLUaHLR//AoIfLY7N3SuC9+MX9hvnNpiw6lzAKpPqg9cbrOrFMxnCso/SAbe+nl ZedIGCJ5rvsJtVaN057ig9V5U/RZ9EUtQjCvI/LmOO52ySBlp14oNsHPWN/Z9/9ATXrL GmmYBheE438zMamv+BiK3QBfAwaBAI1/ltHt518fjZGWuXti9+rESbvyqQ+kmnw6Q4AN jtdLn+6pyeXDbRe2tQ34NdMoQ1cdfM6nPVha9AennNEZeuXEQ+yRbeO2uIXeaGhhTDwQ joYg== X-Gm-Message-State: APjAAAXlUmWy2yaXdhnkC+3MLdVeuP6IuUIHbUY668RAa1pOHU8AIGgt zHJjy+FSXGIN4hyNsb5SXLABp0WOEEY= X-Google-Smtp-Source: APXvYqz6vyMGMRd+dXbtVpPJxuZFuOm7RbSu+gZDr4W/SuoHFAhk8ZrET3N0Ma11rZCWNcrSgk7eFQ== X-Received: by 2002:a65:46cd:: with SMTP id n13mr46507pgr.221.1551372424555; Thu, 28 Feb 2019 08:47:04 -0800 (PST) Received: from am-swift ([136.233.9.103]) by smtp.gmail.com with ESMTPSA id d16sm22999078pgj.21.2019.02.28.08.47.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 08:47:03 -0800 (PST) Message-ID: <63559cf027d4ebd95a844b73b1f20444fb72fb2c.camel@gmail.com> From: Aarushi Mehta To: "qemu-devel@nongnu.org" Date: Thu, 28 Feb 2019 22:16:57 +0530 X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 Subject: [Qemu-devel] [PATCH v3] trivial fix of malloc to g_new in thunk X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "qemu-trivial@nongnu.org" , Stefan Hajnoczi , Julia Suvorova Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Aarushi Mehta Reviewed-by: Eric Blake Note that since thunking occurs throughout the lifetime of the QEMU instance, there is no matching 'free' to correct. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi --- thunk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) size = thunk_type_size(type_ptr, i); diff --git a/thunk.c b/thunk.c index d5d8645cd4..17f3d320bb 100644 --- a/thunk.c +++ b/thunk.c @@ -89,7 +89,7 @@ void thunk_register_struct(int id, const char *name, const argtype *types) for(i = 0;i < 2; i++) { offset = 0; max_align = 1; - se->field_offsets[i] = malloc(nb_fields * sizeof(int)); + se->field_offsets[i] = g_new(int, nb_fields); type_ptr = se->field_types; for(j = 0;j < nb_fields; j++) {