From patchwork Fri Dec 4 19:37:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 337765 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp711180jai; Fri, 4 Dec 2020 11:39:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJz/Qg11Z9iC8m5krE/52Y4UgHFV2CzthosTqDOsinNIzH3hofG3SN9YiiH6FQw/7eTr1Joq X-Received: by 2002:a50:b761:: with SMTP id g88mr9217931ede.387.1607110795893; Fri, 04 Dec 2020 11:39:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607110795; cv=none; d=google.com; s=arc-20160816; b=hF4PpRSSb3QXUSL7OAvOSRl0/De4Ri607IHriEDc/qsKJ/XywPr7Xbkj9VaRgd9tOT qlhQoQQh7sM382fqJx5wzuDnIPkP1iJZOQA9Ayq0I8aqXOXI476qIkKa05x/hR5NjTvt 2DcnMpFCfnrJRnym8a8UrvJf8fxcQF5Id4Oc2fPCcoKy8prUNsIZNmP+OGlNb+xAVvzG tNmnQ6Mn4IdBIjavXhrJoiTBd+AcoFH+/7RmM47Vn4MxVPMGDZorJwSCSInA9JxpR1E+ s2gQZ3pb2A/2w4iGnKYKYrZBfysjZhXXEJID1uAM40h1Bo/EvmO6OEtqRy/oDsRPBDap cQaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QHrtgOkmVbt7F0SZ6xcjfKQyB6OUxHDfCP/a7EYJAVY=; b=eIizT4j44I90OMwCuHMBv20ud1jNhGQcMDvgxo2v0GCheEXip54UQIGp3OHw70cMW1 de7Wc3PNN9RfpIbtfA4v/KECGS9xwgiMq1DOmtZZ8iu9KKe3g0SayoURfpyK6Jm7LFrJ K0jWemd9buqVymBokdXEZlXRiASVdrMZvk409HSudbrwL3k6ML43fqYE1aYCQy0NOtkS /vzd5mXoCQwWizxnBgsfU0uxkg3FbYMTspEwRx2Zoas7vbjUDmNCWaglVUUBRn/W0d2v jxV6NaYB44C8RgnygBNhPP38m38JMbH+V6/5eArWXeA32Z+kT4aEvJaOYWlbucsRWmZQ EyGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oc24si2019239ejb.367.2020.12.04.11.39.55; Fri, 04 Dec 2020 11:39:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730810AbgLDTi0 (ORCPT + 15 others); Fri, 4 Dec 2020 14:38:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:60484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727661AbgLDTi0 (ORCPT ); Fri, 4 Dec 2020 14:38:26 -0500 From: Arnd Bergmann Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Andy Gross , Bjorn Andersson , Ohad Ben-Cohen , Rishabh Bhatnagar Cc: Arnd Bergmann , Siddharth Gupta , Mathieu Poirier , Ma Feng , Rikard Falkeborn , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: sysmon: fix shutdown_acked state Date: Fri, 4 Dec 2020 20:37:35 +0100 Message-Id: <20201204193740.3162065-1-arnd@kernel.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Arnd Bergmann The latest version of sysmon_stop() starts by initializing the sysmon->shutdown_acked variable, but then overwrites it with an uninitialized variable later: drivers/remoteproc/qcom_sysmon.c:551:11: error: variable 'acked' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] else if (sysmon->ept) ^~~~~~~~~~~ drivers/remoteproc/qcom_sysmon.c:554:27: note: uninitialized use occurs here sysmon->shutdown_acked = acked; ^~~~~ Remove the local 'acked' variable again and set the state directly. Fixes: 5c212aaf5457 ("remoteproc: sysmon: Expose the shutdown result") Signed-off-by: Arnd Bergmann --- drivers/remoteproc/qcom_sysmon.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.27.0 diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sysmon.c index d01bc4bda7bf..9fca81492863 100644 --- a/drivers/remoteproc/qcom_sysmon.c +++ b/drivers/remoteproc/qcom_sysmon.c @@ -533,7 +533,6 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed) .subsys_name = sysmon->name, .ssr_event = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN }; - bool acked; sysmon->shutdown_acked = false; @@ -547,11 +546,9 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed) return; if (sysmon->ssctl_version) - acked = ssctl_request_shutdown(sysmon); + sysmon->shutdown_acked = ssctl_request_shutdown(sysmon); else if (sysmon->ept) - acked = sysmon_request_shutdown(sysmon); - - sysmon->shutdown_acked = acked; + sysmon->shutdown_acked = sysmon_request_shutdown(sysmon); } static void sysmon_unprepare(struct rproc_subdev *subdev)