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: 817434 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e11:0:b0:367:895a:4699 with SMTP id p17csp568504wrt; Wed, 7 Aug 2024 13:29:27 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUAX9cT6C6HETD/M6+SHZLO2qPkYeyM2W9zR7KIGxDd3GzeCFMjWiogM8IumcvOij5qPA5jm6BiUgMs9omqdU+Y X-Google-Smtp-Source: AGHT+IFdv2CEES+266JWDDppKI7mvKK1p2boxNH24nGDO9UYYmqpPkJzNT+pvbZDetEseSVDSavj X-Received: by 2002:a05:620a:f01:b0:79d:5c31:718c with SMTP id af79cd13be357-7a34ef032f5mr2391240785a.27.1723062567444; Wed, 07 Aug 2024 13:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723062567; cv=none; d=google.com; s=arc-20160816; b=vO4BuZoD2adPzRTGIZrHi941rjaUJjStw1h7o44SCyZ3aZVDlNGHq3mmChZ09jJVWy Blfo1WPzE/RZVcsyFRqWPRKpSnnWT+GRedSwtTfttLn075dUzrfETG6w1nnaiCpH6pIa NpGhKZ5wanQ9N0V4pUx2DBFMPWsxASOu3svRGbEW+OGXvKWriizWppAFbXdeuwTmSnmI wsIKohVz5p5Lw/w1MgTwNtU8AbKDBLeiPKxxmVuM4m4ePO1YmnLRZKaOkpTMmgqTFzys RCuAGB5CsBTBR8VD8PBUJm3NNZMnVcgi0AjbMb0eEigyXbjuf9XEgPjxEoLaQdMn7Wmu fkkw== 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=i6ryEDlXxlrvMeiKVLcQCfvmoYPTROsSgs3XZya+DuI=; fh=Xd5K6BNi0XEHDFf6w54PvhxwTh/7xCtwnQ3cskUYwiI=; b=IqLk0Uh97bw75weQx7JtKQ588z3eeSCiVDoRXPOCUPm6IueKwCNlh+gfLfAUjOQjC4 bD+uVJj6JDpqgzJvq0OGB2KhXN71R4M0oKcRigJsU6DgZMSrZTQEgqYarRAjs9aP3q5R cI8sY09jJpsw5+4GrT3wgxGTjR1nJgnSoRA0Pe+xJ3v3F1UfpfMqL82d+cn1/rT0XwpY rvIj5cU6CqYhvc16WQnlYze2bC99ot7hr/nn7qmYh/0n7RLLogXcnImAIChKaYsbr8Cn Gw0Sa9MH8p+AHS/au5w14bwmZtU/5uXjPPa3N4OVDT7++uK8/6NPMARN0tLQ8thylu5+ aYdQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yWBB0tQS; 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-7a37882a3b2si238075985a.499.2024.08.07.13.29.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Aug 2024 13:29:27 -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=yWBB0tQS; 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 1sbnH0-000202-0J; Wed, 07 Aug 2024 16:28:42 -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 1sbnGw-0001y9-Ui for qemu-devel@nongnu.org; Wed, 07 Aug 2024 16:28:39 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sbnGu-0006uO-8D for qemu-devel@nongnu.org; Wed, 07 Aug 2024 16:28:38 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4280ee5f1e3so1966045e9.0 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=SxVlMoiTOdSRMA+NbEBjf4QOUOlhsCPIZeYBBkrrL407EfCeY/DDMuGWUS/lmD3ngx rxMv4RarkbWSi2tcUrxlmNicE5HUq7k1O1xyiDke9hpXemb2BUfNhqT9wcNffog02Crj UQKOcLkT+1QA3Csy6BCblZ9E9HQVhFlzz5Npwpa0Q/T9PFcyuKALNGFoxVQUIKZowbMC /RdDe4GmE7PCRTAjMuO/VxurMaxfpjLKfbzhGtS4D5V7ooy2ma3bASQwrxemKebO13Xg BkP7UZV3BbArKDBUcwiIZJ9WDAzHl+VZjlxvmdvzA0N9DfAS6yQTDoOj/EgQQcT6cphi m+2g== X-Gm-Message-State: AOJu0Yy8HpwdtP7HsMdtQu1MogANMy5CU7gctK6nLF5Dgf+vU6AqGAFD fQ6EqIOGYbOIk2ALnzkrStOd9YDxxGdhV9sDSgtrL7l5kUHLTH606heuQNE3wSiQxD1FX9a7o82 V 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::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 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)