From patchwork Wed Aug 7 20:28:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1970242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=cQOFieRs; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WfMFp5Fv6z1yXs for ; Thu, 8 Aug 2024 06:28:46 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbnGk-0001Vt-Qw; Wed, 07 Aug 2024 16:28:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbnGi-0001OP-O8 for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:24 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbnGh-0006tN-5w for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:24 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3685b9c8998so125022f8f.0 for ; Wed, 07 Aug 2024 13:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723062501; x=1723667301; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8TvYvkgtExP5sUQjhWB+PYXRtHHu4raSI4RPFwJP3Ws=; b=cQOFieRsWo3zFPryncg6Yzt2bYMHK3Fc2VarD4w8lkw/vBDA9E30FGvhsDpNk0z3lZ WEZd3jEqo+ZihC2+yWZolEY8vriE8AKzmqtyWR160PP/l0mVp2lvCnQ2DhT9RUGRLgrE 4pdCQwWgHCAWp1YB33DoD8wae8q8qhG2zwYsyOJ9JkEZccm807u3wLRbzJFt8dWN6Igj dAdlxSCq3pPykHVw/q/Ib/C9M+TYS5uQqH7YsiQItL19gpiENCp4sT122+3TkMG/rGco VXhmVgpY3NQwDJxnVUFrwSnsDZ6SCcZ6iTQVu8TgOrHIOZNv06lEd/aePJ14B3oJNZtw r24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723062501; x=1723667301; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8TvYvkgtExP5sUQjhWB+PYXRtHHu4raSI4RPFwJP3Ws=; b=p411/dIxxJzYhQx/KAAqX/Ib8HtsmldbiXs7qtCZGf9l1JezgIVNVjXLhGzvof1M0j /7UaHC8amTfIR2jBBVQzHcIZbHb4QZn2pLVMhKt91Tzm2F+pvq37GOCnin3BpiS5+ZEG xzTn7EwqacO/oAu9hApeYgvRkAdGucDBUAn5CgpS2k0UUbBrUaey5c9RQWGQjre1zfit TjDr2l43e9fTIIBEDAlKNFGv2zRMjtDdpCS380nf8peCWmkIFLA20jvkhlVCAwnsmDhm p/mfgmp7FwSdg9HqW3hM7lMn1eQkbKKEUGYI0rdVTmQ9Zsco4GUuokak+rVtDs0NdHHL 1YuQ== X-Forwarded-Encrypted: i=1; AJvYcCWs5HnJxuDEu9Zu9z6/W5PW0hFGZmt0X755vhR+qWUnI3H0KVyJANrniSqAWCNdjuYkWC550X9XUYbsyR6/qu/xoUM1 X-Gm-Message-State: AOJu0Yyzvxz/G8xBqh+6yrQ5G3SGGDUUISl2yEI6Oinb1c7SkhT1np0e XYWeoRzOeMnis7gQxcSc8OiXA8WlDF5tBkWNzN9cNIwyMqgDyAGHxJG4h+lFHmg= X-Google-Smtp-Source: AGHT+IHOyjy+7uKf5bPFYEQkCrY89yhGTbPxF6nC3jMe2anh6X3XRwl2576WDTJXCadyYi9NijXH2A== X-Received: by 2002:a5d:5e11:0:b0:36b:cc42:29f9 with SMTP id ffacd0b85a97d-36bcc422dbcmr9853284f8f.51.1723062501267; Wed, 07 Aug 2024 13:28:21 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbcf0cc8esm16889501f8f.19.2024.08.07.13.28.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 13:28:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Glenn Miles , Caleb Schlossin , qemu-ppc@nongnu.org, =?utf-8?b?RnLDqWTDqXJpYyBCYXJyYXQ=?= , Alistair Francis , =?utf-8?q?C=C3=A9dric_Le_Goater?= , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH-for-9.1 v2 2/4] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() Date: Wed, 7 Aug 2024 22:28:02 +0200 Message-ID: <20240807202804.56038-3-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240807202804.56038-1-philmd@linaro.org> References: <20240807202804.56038-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org pnv_spi_xfer_buffer_new() allocates %payload using g_malloc0(), and pnv_spi_xfer_buffer_write_ptr() allocates %payload->data using g_realloc(). Use the API equivalent g_free() to release the buffers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/ssi/pnv_spi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c index c1297ab733..13a47f07e7 100644 --- a/hw/ssi/pnv_spi.c +++ b/hw/ssi/pnv_spi.c @@ -53,8 +53,8 @@ static PnvXferBuffer *pnv_spi_xfer_buffer_new(void) static void pnv_spi_xfer_buffer_free(PnvXferBuffer *payload) { - free(payload->data); - free(payload); + g_free(payload->data); + g_free(payload); } static uint8_t *pnv_spi_xfer_buffer_write_ptr(PnvXferBuffer *payload,