Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp660891rdb; Sun, 28 Jan 2024 03:34:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IHVEz7GwSRrKstnlwGUa1MiQ+4epb6hMMSLAbBQsGiPsUVRPKJoNtwZPWR1QPs5cew9gTQz X-Received: by 2002:a05:6a00:4f08:b0:6db:d986:5c1a with SMTP id lb8-20020a056a004f0800b006dbd9865c1amr1010570pfb.25.1706441696500; Sun, 28 Jan 2024 03:34:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706441696; cv=pass; d=google.com; s=arc-20160816; b=VrRPAOZeSZ+nYLIp3aQeG+3/ea+mTJ45rr+PJcuhciIyGBoZoBI8TGSddvEiblkuiY S4HBmHskG1vjC9cfsJsyR8yMWnoNyA3pgKVqY+79pU5Q2Szvy3zE645ip+B30UOp9WzU UAOpAr0Ihvqv5OpbCO8/g/WKpsJoDBPHrwD3y8QnwWh0ye3j+EtM+ihx8SAHZjNxnKDX utMshb4SboUFVEN8RuPXEadu+boU5gcHgMZuvmoIkg5TEU/7rhXm2o/AFEiw8UwBY6Lh 4S03AVmlRxTdUH8HLAnxps0WD2UhpduHMM9uJ9okVHoYQteVrnisDoU6B58PVk+X2kvt cFkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=bty2xukFdRkPEFlCnTL1HrECxC57pxJIVp0ohvU2AgA=; fh=Xs9Koqj9khZkVbwpiLWPAEv0SUXiekrXALHYWV1rB7I=; b=wfhvKQf4bzc+vCz2J/yE0Lsnxaez3nADX5V7Wgh2RH9M55Y9TDCSn+5/K3ccuXtncr zFMiUk0a4nlcEW8uK3qOxawL7gW+7PkwF5B1cIkCw6jHdLnbcdIPFnLX9MLb2R0Ih+Ua D4d5Zvl4TFSl5uSMhGQnrYl7plpHztc/qdoNY+82OpMpSqWtDDha44zckD1p+BhKc4/t g7PMPatVvpLm6JtKbLzH7Ox+woa5lms7nw0wLM58K1xfve3gb7QJ4fdWEuWcOmyqByaY sUUzj070QveoORtMa1nLjpMGGJ3/dXj14Y5+2GJQv0Z3jfpiQ+xvoWsHKHA1qvNQffYX bhkg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=q8lyiM9W; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-41601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p14-20020a056a000b4e00b006dd7e62021csi4170027pfo.338.2024.01.28.03.34.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 03:34:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=q8lyiM9W; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-41601-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41601-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id AFCDB283761 for ; Sun, 28 Jan 2024 11:34:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFAD5208D5; Sun, 28 Jan 2024 11:34:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="q8lyiM9W" Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D37D1CA9C for ; Sun, 28 Jan 2024 11:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706441682; cv=none; b=DYGr+iJd3fPTDhTZPVtfFeuoKKYihFZ0mS1WUAywWW6MTXh1R5JPiqzXuXIqCTJrCDc/ffg8R5DQWDVQgx0mGDnUBpNDPzEWIgcTDZSNjohTG9F99+VV1vw2KRk6KCBBgc0ihsEB6ejot9UNtphBrZiyMN0ZGFs5QiCONuztjuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706441682; c=relaxed/simple; bh=KIqqe6b7++tdELzI8weZpXwb9c1lX1twgOwQ23G4KaU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=INLhJ0yQYMRLW3yADX3vaawa6pDrp3xStg7nvmn6ExpF9/VHMUVu4LrjY2J1xCpYdUAb/LY5vnjaVKJcTkfcgzMBzB6HA2noumRDActVKnAwEVR/4S27UFz4Q76JGcQt6Pz9WLh9GPLH1O6pAZhQQkTrh26JeyEdX2Gx6ZNxmYg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=q8lyiM9W; arc=none smtp.client-ip=80.12.242.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id U3QhrO2WGJujcU3Qirni2Q; Sun, 28 Jan 2024 12:34:30 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1706441671; bh=bty2xukFdRkPEFlCnTL1HrECxC57pxJIVp0ohvU2AgA=; h=From:To:Cc:Subject:Date; b=q8lyiM9WQo/EgvGQysdvx+kePnrw+P5IQ8+wLP2buInfRszrFigPMdnwqTLcwekay vxgYWtn0UQ+qlLLJH6llJzZRvaCGAwdSDbWvN6MzDu9zJPkJlMt2ntFi93UwdbbudT KhHTSLQ4dxRf+1xEoK3P5vX3oQwnX1hfDina0d1b4sFDov8yKJA3eUUXk6ppcwcRf8 599nG14+4uqV+HixiKORto7wOAZ2vzJr3Z9XKK6lCBItSgDixxsBCp6rPYHzNRHZ8U Gt+ZlR2tLvuG91dcgdYNZABgVG238N+WPdZrts6wUkezYezM+bH9s7SjtfUkAomxjO jFHBjw2MxLgNw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 28 Jan 2024 12:34:31 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Michael Ellerman , Nicholas Piggin , Christophe Leroy , "Aneesh Kumar K.V" , "Naveen N. Rao" , Vaibhav Jain , Kautuk Consul , Amit Machhiwal , Jordan Niethe Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , Gautam Menghani , linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org Subject: [PATCH] KVM: PPC: Book3S HV nestedv2: Fix an error handling path in gs_msg_ops_kvmhv_nestedv2_config_fill_info() Date: Sun, 28 Jan 2024 12:34:25 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The return value of kvmppc_gse_put_buff_info() is not assigned to 'rc' and 'rc' is uninitialized at this point. So the error handling can not work. Assign the expected value to 'rc' to fix the issue. Fixes: 19d31c5f1157 ("KVM: PPC: Add support for nestedv2 guests") Signed-off-by: Christophe JAILLET --- arch/powerpc/kvm/book3s_hv_nestedv2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_nestedv2.c b/arch/powerpc/kvm/book3s_hv_nestedv2.c index 5378eb40b162..be5f87e69637 100644 --- a/arch/powerpc/kvm/book3s_hv_nestedv2.c +++ b/arch/powerpc/kvm/book3s_hv_nestedv2.c @@ -71,8 +71,8 @@ gs_msg_ops_kvmhv_nestedv2_config_fill_info(struct kvmppc_gs_buff *gsb, } if (kvmppc_gsm_includes(gsm, KVMPPC_GSID_RUN_OUTPUT)) { - kvmppc_gse_put_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT, - cfg->vcpu_run_output_cfg); + rc = kvmppc_gse_put_buff_info(gsb, KVMPPC_GSID_RUN_OUTPUT, + cfg->vcpu_run_output_cfg); if (rc < 0) return rc; } -- 2.43.0