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: 817433 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp568500wrt; Wed, 7 Aug 2024 13:29:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXHhZAvMB8u4hVWcIv35f7O4PNQP0iOuBMNKxitwr1achzI31CYuGGKCKgZmMZoaVMF4bQ3Frg4kfi0WmldIAxU X-Google-Smtp-Source: AGHT+IGw31AJ6ymhKzfVkBH8NbpY4tZ675smUaLmfmYw4lyyomwmFf7PGy4dWNPSXo4ESVcAZ4Xa X-Received: by 2002:a05:6902:18cc:b0:e0b:a8e4:ac75 with SMTP id 3f1490d57ef6-e0bde3c94afmr24758393276.24.1723062566901; Wed, 07 Aug 2024 13:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723062566; cv=none; d=google.com; s=arc-20160816; b=uamNe4EmFYwDHvZ0ZgdEJFEWkIXTdb8NDPctO8HFOnPCnTwo4RIds5X1zaIhfnda4/ Xa0E7AaiBPSFyrvdQNa3SB5uuN6u6rQ8+D+WiCrKvDnz7u11CXRurBN+CjwAUxy6M8KF Yv2f54+8JoanISMXLTC2f1GP1ETCBP4c9me5vd9aIYNqdY0IhrUrogohw8r6p8iG3WUM 6zxfVgY/WmO8gY10oNXlVU0vv8izmhbtylvsnU8P9T1NuDu85LMoFbKJSCglYwS8BClB V33ojU1drXWLgkh06BrOd2mYE+LAZmWZsmTzhFZ72nqdPl16/MeriRcE9Fw5Eo/hNbV/ SEww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8TvYvkgtExP5sUQjhWB+PYXRtHHu4raSI4RPFwJP3Ws=; fh=6G+iYi/ST5uLBPXNX5mPf6b96Juu7dKn/IuqzV14oqE=; b=RFU2HleVWFWR/RRrBm3g4mBiWVh4MgLcjlV81UCqZc9+RNK0Ms4deu7GBlB4OCNq9B KdN0K2y5RpjXz4Oox39xGHEEOuoO+DMXEfJ0GDc5T1FNU+OiwMXVY0PhKE7/EZzpvUVz CQDckJ3JyaLAgPL1/CfafJ2h9dXV06begKqhVBa+xJ66x8MipUr4HqBeBHd5nuba3qg5 /V9FfsoHla63jwim9zYipodSgdOapoUb7ZrutwlwSpNNzvp1yZKC+P/A7ThzL5YAXaAr uDx75GpurXtYtlmRdd7Io6a7BVtsb1KS2X8kafYuiDaoPfRMWYqxBiG8qUaBMtzvn6mZ 4jtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQOFieRs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a37884b9c8si243629185a.664.2024.08.07.13.29.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 13:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cQOFieRs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbnGq-0001Wy-5y; Wed, 07 Aug 2024 16:28:32 -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-0001Oo-Rs for qemu-devel@nongnu.org; Wed, 07 Aug 2024 16:28:24 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbnGh-0006tO-7n for qemu-devel@nongnu.org; Wed, 07 Aug 2024 16:28:24 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3686b554cfcso123729f8f.1 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=aAdJ7qdlfB39k5Y2eOR1L1YBuTVO/BamF2P+I2hFID7yVpIvcD+JclMuvHe/iNo7cv 3B0l61fr3pVotsv9LagsixcjF/Ktnhj5Gd2NpjBqzt3pRDfsA6zN4qv3Tox+2SZtBLNO Qj+I+3hVleJSTUfuME0RpJ/5tS3cgfWrb3cJeJ///SBiuy2P32mDgG12Oyc05A4pcEj9 x9qPIJyTcjPPQIX6TskRyzyaWXc33kBz41SaduxY5Uk2PK8Spl58ldUlbIBEjPpuVsdp jFszJoeMt9bqzRbRkCrnJB004Tom70O5V2pKme5Ums7OmoTenSF9ScNgPentZcdWMcWO Lotg== X-Gm-Message-State: AOJu0YwCEchnN3dGOBNbEAWmUMPLg9+WRyh/Tvx5jvuSZ8+CWnIia1lr qrg70PBPKkTlICfrV58k2fIMLKdSDX2SGAbkGoDb1ilzKI1ijk/KIo0Pb3NVt0IuGNXJFnz22N6 W 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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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,