All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: sysmon: fix shutdown_acked state
@ 2020-12-04 19:37 Arnd Bergmann
  2020-12-07 20:10 ` patchwork-bot+linux-remoteproc
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2020-12-04 19:37 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Ohad Ben-Cohen, Rishabh Bhatnagar
  Cc: Arnd Bergmann, Siddharth Gupta, Mathieu Poirier, Ma Feng,
	Rikard Falkeborn, linux-arm-msm, linux-remoteproc, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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 <arnd@arndb.de>
---
 drivers/remoteproc/qcom_sysmon.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

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)
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: sysmon: fix shutdown_acked state
  2020-12-04 19:37 [PATCH] remoteproc: sysmon: fix shutdown_acked state Arnd Bergmann
@ 2020-12-07 20:10 ` patchwork-bot+linux-remoteproc
  2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-remoteproc @ 2020-12-07 20:10 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-remoteproc

Hello:

This patch was applied to andersson/remoteproc.git (refs/heads/for-next):

On Fri,  4 Dec 2020 20:37:35 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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;
>                                  ^~~~~
> 
> [...]

Here is the summary with links:
  - remoteproc: sysmon: fix shutdown_acked state
    https://git.kernel.org/andersson/remoteproc/c/9d7b4a40387d

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] remoteproc: sysmon: fix shutdown_acked state
  2020-12-04 19:37 [PATCH] remoteproc: sysmon: fix shutdown_acked state Arnd Bergmann
  2020-12-07 20:10 ` patchwork-bot+linux-remoteproc
@ 2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-12-29 20:15 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arm-msm

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

On Fri,  4 Dec 2020 20:37:35 +0100 you wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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;
>                                  ^~~~~
> 
> [...]

Here is the summary with links:
  - remoteproc: sysmon: fix shutdown_acked state
    https://git.kernel.org/qcom/c/9d7b4a40387d

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-29 20:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04 19:37 [PATCH] remoteproc: sysmon: fix shutdown_acked state Arnd Bergmann
2020-12-07 20:10 ` patchwork-bot+linux-remoteproc
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.