From patchwork Wed Aug 7 20:28:01 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: 1970243 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=fMM8OGjp; 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 4WfMFs4hchz1yXs for ; Thu, 8 Aug 2024 06:28:49 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbnGg-0001Ih-7U; Wed, 07 Aug 2024 16:28:22 -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 1sbnGd-0001Bx-HT for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:19 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbnGb-0006su-Fz for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:19 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ef7fef3ccfso1836561fa.3 for ; Wed, 07 Aug 2024 13:28:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723062495; x=1723667295; 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=iIi2lHvDdEsZKrUItMJRcgJ0QP34OToUQAWwLAh7heE=; b=fMM8OGjpsm4XcmXoZCocQnq7ACgb3PZBlzFpDB6RhHe0MElC5qtTCa53i7rEuBoR3l obN8lontnvqoIYMo6SCqorCF/gQNjcIXjX096bzVci1QYKEV3BUvWBfdNtWMD5fpyZiw LANqMV4SsutJK6v4vzfBZFpDS7z1LhpDNW+qsAJ0uc4saFrbPQWWeSFe9WAg4ZpCrRma EE6MBdqHMH/8zCRQIV66bQ2a1a+wXZP5rFYI/hsLaki+CxfYtyHA/1ipkt/kQxTHSCxN 12huhFwVU2INnaxMj00qlIi7ZWzqSbgsH3AF5zxUODYV1gB07FfdjDwOJbFxYzbu+eiZ is5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723062495; x=1723667295; 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=iIi2lHvDdEsZKrUItMJRcgJ0QP34OToUQAWwLAh7heE=; b=eAYLLJnzA3CA6ZuCG9q8KZXjBq6eWK4vgNfakG7nEtidtKvsVB6IvBh821o/blWcQV tHJH6ygPJU9UOvIO4heUaj8N8uJ9UqrK/fn3vmRwPU5tbfCNPmg8XGs8e2dVfB/FDBlz VZIX3AWDwZXVLNMDAnrRBbS7BB8q53Oe6vB5zmcQ0vlUuBYRxeXb26v7o4TYv5twRcoS BBdDgkzCMWPT3pkC+5aR3Zitb/eRp1MWkIvss9D/1xq0Ws7CBH8il58E71RblP9wMgCl GMERlCUoPNU3wqlcouXKRN8bIlgbzyIo41uldT2EYk4Yv9LGB0lcSN2NcIDs/ne5+Lq/ NY8Q== X-Forwarded-Encrypted: i=1; AJvYcCWyY+rncmbMkoS6KSI/jFDPfcWiHxtcWy4l2lZ6YrOcuZElJ8l74IkYwDaGxwHzQQpU+VpQSLkQyePx/GFTy35lEgab X-Gm-Message-State: AOJu0YxDY6ay4WTWcfKo9epLUP8ac6K06M+Cf1n8dFWsJtZHhlEXl+b1 BBXUgYZ3Uap2/KJCA1S3ODVZ1Hqg234LEOXAfunwjLoV0g+xLOJ9C/pXvAdQNZc= X-Google-Smtp-Source: AGHT+IG8mxjT3+WiO8rxjUomEIUQ0tcfydWJYxdop68T+WHyY/YaKAB2SipzgMCevNgDbSDPP5oFow== X-Received: by 2002:a2e:a0c9:0:b0:2ee:8720:b4c3 with SMTP id 38308e7fff4ca-2f15ab1c1a2mr125847111fa.43.1723062494955; Wed, 07 Aug 2024 13:28:14 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290580cf79sm43019145e9.48.2024.08.07.13.28.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 13:28:14 -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 1/4] MAINTAINERS: Cover PowerPC SPI model in PowerNV section Date: Wed, 7 Aug 2024 22:28:01 +0200 Message-ID: <20240807202804.56038-2-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::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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 It is unfair to let the PowerNV SPI model to the SSI maintainers. Also include the PowerNV ones. Fixes: 29318db133 ("hw/ssi: Add SPI model") Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 74a85360fd..52843876ab 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1542,8 +1542,10 @@ F: hw/ppc/pnv* F: hw/intc/pnv* F: hw/intc/xics_pnv.c F: hw/pci-host/pnv* +F: hw/ssi/pnv_spi.c F: include/hw/ppc/pnv* F: include/hw/pci-host/pnv* +F: hw/ssi/pnv_spi* F: pc-bios/skiboot.lid F: tests/qtest/pnv* 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, From patchwork Wed Aug 7 20:28:03 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: 1970245 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=qYOa2xoC; 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 4WfMG30pkQz1yXs for ; Thu, 8 Aug 2024 06:28:59 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbnGs-0001jS-TB; Wed, 07 Aug 2024 16:28:34 -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 1sbnGp-0001YA-Di for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:32 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbnGn-0006tx-LT for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:31 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42816ca782dso1876685e9.2 for ; Wed, 07 Aug 2024 13:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723062508; x=1723667308; 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=64V2wCrrYmQb5TKOeGR5XbQEWlSQEIaOZkBcAH6L56E=; b=qYOa2xoCjjcofywzBJvPEsG4kUCgPi6vTeyxn4vDQmXCn6Q1wlfCuLZEjuEM31VdT1 A+4xkja2avrRw7mxVCgY+N/WcjpYi8NWLE8zQNwlEpPmlYtcogQoGMLL2e9umSLN7KrM g7Hj0NXTY5FTVV58932/xfjXqXJRLir8Yb6Bm3S33u9xdlgEymjY2AeQQksrSE7NZu8d XSxgHKE4jYbgkTlc5z218aw1Plk1UnUCazvBgX3G1Eh4y2WL80OVaCzHHphJF1o5Z/3D qYCMiHFHoVqoKeuuAOXIGMbSfrZAy91P4pVDlsVBPpMOzDIF8+AMDCpybfoBa8B7R4q4 GQOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723062508; x=1723667308; 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=64V2wCrrYmQb5TKOeGR5XbQEWlSQEIaOZkBcAH6L56E=; b=HrI4N6YVP6VMAUojdt00WhgZOxelU9ccRQjcjrMEGRG6adEb8wCAhUHNFq3eoS+KOi 1IpNCfzZQqv8Ycf1UbFQjb+fK7H3144TX1Tfj4k9HqYaqhucayjOR/+hQDsrUexAQ+GK Xb/KJcVGAFZ7Y7kOImiKUdV99JAnCronUVy42L2HHI4eVFgbzfKeZXKpnClH9Su8aydz jYhRiie71qju7ypMKKXob2k1dJesilrJlyMf+ETngTL9uIvoLVjmEMXhB49REYlVtMSD 7OAyHoR6EcrxFnXgJseQoP+hNGtiurfxdEc0dQVc9UzdP8KJqSS30nD/a7cBqM7r/kar 5qFQ== X-Forwarded-Encrypted: i=1; AJvYcCVUvVeDi0SPIdCYAzCytItk5sCLh1CheJH7mi7pH9V7t1oETin4jsgcaFfNuIwZvL7c0ZG02sHT0Hyk00XvTsSTQ4ga X-Gm-Message-State: AOJu0Yz3tctcnwINCNKdW7OXFd3nJMQwjw9TeguxYJ0qBXkn2TI0Wxq+ bycYJsb3/c9Os528ttjbgJ0WysiPt7fE+tGjo/mto9H2kypNjsm0x58AS8EW+7hx7Lt3n+yVkeP e X-Google-Smtp-Source: AGHT+IF6EVqFQ62pSG19zvVCjx6YsEtR7MuubzLMXC/MVgAuhBvZKH0S9QdDlNTK2rJnUhwDglEiEw== X-Received: by 2002:a05:6000:d2:b0:368:71fa:7532 with SMTP id ffacd0b85a97d-36bbc0e7225mr11786735f8f.31.1723062507881; Wed, 07 Aug 2024 13:28:27 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36bbcf1e0bcsm16946687f8f.30.2024.08.07.13.28.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 13:28:27 -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 3/4] hw/ssi/pnv_spi: Return early in transfer() Date: Wed, 7 Aug 2024 22:28:03 +0200 Message-ID: <20240807202804.56038-4-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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 Return early to simplify next commit. No logical change intended. Signed-off-by: Philippe Mathieu-Daudé --- hw/ssi/pnv_spi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c index 13a47f07e7..05e6afc11e 100644 --- a/hw/ssi/pnv_spi.c +++ b/hw/ssi/pnv_spi.c @@ -217,6 +217,9 @@ static void transfer(PnvSpi *s, PnvXferBuffer *payload) PnvXferBuffer *rsp_payload = NULL; rsp_payload = pnv_spi_xfer_buffer_new(); + if (!rsp_payload) { + return; + } for (int offset = 0; offset < payload->len; offset += s->transfer_len) { tx = 0; for (int i = 0; i < s->transfer_len; i++) { @@ -235,9 +238,7 @@ static void transfer(PnvSpi *s, PnvXferBuffer *payload) (rx >> (8 * (s->transfer_len - 1) - i * 8)) & 0xFF; } } - if (rsp_payload != NULL) { - spi_response(s, s->N1_bits, rsp_payload); - } + spi_response(s, s->N1_bits, rsp_payload); } static inline uint8_t get_seq_index(PnvSpi *s) From patchwork Wed Aug 7 20:28:04 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: 1970246 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=yWBB0tQS; 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 4WfMGG3l7Hz1yXs for ; Thu, 8 Aug 2024 06:29:10 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbnGw-0001wO-8Z; Wed, 07 Aug 2024 16:28:38 -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 1sbnGv-0001tT-FS for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:37 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbnGt-0006uM-Si for qemu-ppc@nongnu.org; Wed, 07 Aug 2024 16:28:37 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42808071810so1860325e9.1 for ; Wed, 07 Aug 2024 13:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1723062514; x=1723667314; 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=i6ryEDlXxlrvMeiKVLcQCfvmoYPTROsSgs3XZya+DuI=; b=yWBB0tQS3x/zbLLG5yYzvkI66qaduOSxYEAG7FSlLKSlV09G4cX3dc2PiSvo281pyZ lcJSLxTd8VMQyrmp2p8G23X1K7NcG9UAkpxUyeWfHEtw9Fm18ozYFsBOUFJakW+MFXCv wVzRVb0/eAWd2BKZ0WN6Y3ci5o6splvjw/ke4K7d1AvAecf37d5Alb6QrpoTInBVxLCW JDagWNd74Z/meDBtFlzR6q21Mk5EjAxZqic7ILSnZix9AiQErRmu6xUhn0MrNXaYBC0B e+uRqO1S2/YE1nvZygHHxTHR7JJTIBamvT+qbhgSgfhs3jhMjBy+ZihcEfKzS05Nxu2h PKAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723062514; x=1723667314; 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=i6ryEDlXxlrvMeiKVLcQCfvmoYPTROsSgs3XZya+DuI=; b=xIIlnWHlCp61pxZpFJcp9m1K7DLXTfKf4fgKjU+DyLmJ/2RqzQDELyMneUuw/HPezr M0OLMFsWiEJeKrLqQw5w6OlBkf4SFPmtuaUZxEiE24duO6bZ1BwCaUm76kN+VRqVHmgM mViws8olhvSuW8wH3IxY3jMbADcJFJk9Lu/NJMEKWp520sX4mYKnrRP1UhgEYcovCapn WQ4sUdN3U80k8xPUredsa2OzHk37EbmYd6nVqgHxRGmc8fvJAtCQOqGVyi+VkxnMv5mj ySP/W4ytQZrq4yHzq7DGDRqknmhQgLn2gNyx0+nAH1GYli/Yls4oPV5N5eQHtZeVFiLM TCYw== X-Forwarded-Encrypted: i=1; AJvYcCXVhP+m3vfkvTnDWarUjmbeazBwCsClvU9dXMDDlsp9ziz7FZQvKmZJDbJ/NJe8eqstZmyIBWAWbYZQHLO6t7ZQd7NZ X-Gm-Message-State: AOJu0YyJoWVGrFfAMwPT+CRZPy2QmAoVntkbxVKLB0UCj3+Uymr0PCdS tRBqF7blZh2U9VZPJhx9guUaQJdcT3ZqYGcgehT073pUYQuZQcPc3tHfc/eRBEwaGjnaTSTM7uB N X-Google-Smtp-Source: AGHT+IE1Jd3/3I1uB09/WeI2RIs6cGzJ5SzwkPTGSv9BFq68vOR+/N7AH/sdomEHd0F5YrMMlYyGLQ== X-Received: by 2002:a05:600c:470a:b0:425:7884:6b29 with SMTP id 5b1f17b1804b1-428e6b08a32mr142794275e9.19.1723062514246; Wed, 07 Aug 2024 13:28:34 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.120]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4290580c573sm44258595e9.39.2024.08.07.13.28.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Aug 2024 13:28:33 -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?= , Chalapathi V , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH-for-9.1 v2 4/4] hw/ssi/pnv_spi: Fixes Coverity CID 1558831 Date: Wed, 7 Aug 2024 22:28:04 +0200 Message-ID: <20240807202804.56038-5-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::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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 From: Chalapathi V In this commit the following coverity scan defect has been fixed CID 1558831: Resource leaks (RESOURCE_LEAK) Variable "rsp_payload" going out of scope leaks the storage it points to. Fixes: Coverity CID 1558831 Signed-off-by: Chalapathi V Fixes: b4cb930e40 ("hw/ssi: Extend SPI model") [PMD: Rebased on previous commit (returning earlier)] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/ssi/pnv_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ssi/pnv_spi.c b/hw/ssi/pnv_spi.c index 05e6afc11e..eadc36fa86 100644 --- a/hw/ssi/pnv_spi.c +++ b/hw/ssi/pnv_spi.c @@ -239,6 +239,7 @@ static void transfer(PnvSpi *s, PnvXferBuffer *payload) } } spi_response(s, s->N1_bits, rsp_payload); + pnv_spi_xfer_buffer_free(rsp_payload); } static inline uint8_t get_seq_index(PnvSpi *s)