Commit 9d7b4a40 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Bjorn Andersson

remoteproc: sysmon: fix shutdown_acked state

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: 5c212aaf ("remoteproc: sysmon: Expose the shutdown result")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20201204193740.3162065-1-arnd@kernel.orgSigned-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent c3c21b35
...@@ -533,7 +533,6 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed) ...@@ -533,7 +533,6 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed)
.subsys_name = sysmon->name, .subsys_name = sysmon->name,
.ssr_event = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN .ssr_event = SSCTL_SSR_EVENT_BEFORE_SHUTDOWN
}; };
bool acked;
sysmon->shutdown_acked = false; sysmon->shutdown_acked = false;
...@@ -547,11 +546,9 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed) ...@@ -547,11 +546,9 @@ static void sysmon_stop(struct rproc_subdev *subdev, bool crashed)
return; return;
if (sysmon->ssctl_version) if (sysmon->ssctl_version)
acked = ssctl_request_shutdown(sysmon); sysmon->shutdown_acked = ssctl_request_shutdown(sysmon);
else if (sysmon->ept) else if (sysmon->ept)
acked = sysmon_request_shutdown(sysmon); sysmon->shutdown_acked = sysmon_request_shutdown(sysmon);
sysmon->shutdown_acked = acked;
} }
static void sysmon_unprepare(struct rproc_subdev *subdev) static void sysmon_unprepare(struct rproc_subdev *subdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment