From patchwork Sat Nov 9 12:08:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 842110 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp2123822wru; Sat, 9 Nov 2024 04:37:56 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUAvSa8d1i8Z4eLBRhTCxwDce/1MZINauKOTJ4NLEE+hvMgeQ4+nqhMlOP4Q1wQ9ZkZ0FDkBA==@linaro.org X-Google-Smtp-Source: AGHT+IFBZGNiE6SQZ7ATe9ytyHQmjFqiohUdtZt5Yrxe+SH4VMFdanv7CcDBFTQJ69GeoYdCNxJm X-Received: by 2002:ac8:5856:0:b0:461:4175:b6c2 with SMTP id d75a77b69052e-4630941151fmr87884011cf.41.1731155876707; Sat, 09 Nov 2024 04:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731155876; cv=none; d=google.com; s=arc-20240605; b=VHwmQmk2LcMqVBK5sSyAk6xffc/2JNp+V/n+I7mkL5OonZF/hBiBcDR92vMz6mCcX5 H3yZEVf+2BFTx99go8RDoetCkvEpWEDygcFPgP94eU7A+4HZnBRidT5vT6JU6McX9Uby WSmfFB7heBULu1PV/kCQkwXKysuTOi6+ghrNlYi3r5V2G/ucchTJuTIjqOdYfn+0fSmQ OceMJjnWbbzB6AalrxQvbLvIM3bAXnmrrvtl4xedjZoJDMi4xVeMvofb4IVMR0SOr3mP TLqaX+BWYkvrQXUppzWUblk3eHb98cpRvLikUBZicjNaYzREMSI9CpDf4n2B2j+nLL4+ SF5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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; bh=3VWFCPI/x0HdEB57VJQHuw1tXDEh2Kq1A9ZmC1s6uIM=; fh=b3UPAyU3lbSqcc4aWn9rnaQVuq4B2GrA2SOlxi9bDqs=; b=OrKS7pW+GBMDLVl2RCMt5BWOms61zY3jrv23dj2S55vgg0D1iq2tNSci50a5JX42NB JWaUVK/3iS6bCbJ+8hIov2cfmJvn7y//9HhuzJBp93cYCuUaEEGp0TRcSre6sjMlJjou rnhS8sF3MVPe6AbXSjARnNLqjQ3m3GClz4N1LX9/QCV/fAxcbWrNSrPNjuyev9GERaAM qtQPf6juDkIT+v7xD/ip3lmO6YqH03HvjKOb9gTxWIN7ib+Wx2whDTtnnGKmUL0A5OnY yNoIISxkaXaSQ6mz5OYJGfHYtZEbJv8HRxnxT41DyjxuDEqj4Z8j2nSCVePiQRw1+Vt4 fvUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ff5c767asi59791361cf.338.2024.11.09.04.37.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Nov 2024 04:37:56 -0800 (PST) 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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t9kTm-0005bn-Kp; Sat, 09 Nov 2024 07:22:14 -0500 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 1t9kR9-0001yG-Jh; Sat, 09 Nov 2024 07:19:31 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t9kR5-0005WH-0v; Sat, 09 Nov 2024 07:19:28 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7ACC8A1656; Sat, 9 Nov 2024 15:08:09 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 4039F167FDC; Sat, 9 Nov 2024 15:09:04 +0300 (MSK) Received: (nullmailer pid 3296263 invoked by uid 1000); Sat, 09 Nov 2024 12:09:01 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Nicholas Piggin , Michael Tokarev Subject: [Stable-9.1.2 44/58] hw/ssi/pnv_spi: Match _xfer_buffer_free() with _xfer_buffer_new() Date: Sat, 9 Nov 2024 15:08:45 +0300 Message-Id: <20241109120901.3295995-44-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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 From: Philippe Mathieu-Daudé 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. Cc: qemu-stable@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Nicholas Piggin (cherry picked from commit 65f53702d2e4bd045ce16ca874469cdd1e1ef4e4) Signed-off-by: Michael Tokarev 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,