soc: qcom: initialize local variable
authorTom Rix <trix@redhat.com>
Wed, 19 Aug 2020 18:46:37 +0000 (11:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:53:19 +0000 (11:53 +0100)
commit6d3131ace30336bb03b8b322e4fd6fdae7a6f4a1
treeaa62a04ffa71f7c8e6082344366825a37216c17b
parent561397df16e3fa730fe3340f3065353ffcc18e07
soc: qcom: initialize local variable

[ Upstream commit a161ffe4b877721d8917e18e70461d255a090f19 ]

clang static analysis reports this problem

pdr_interface.c:596:6: warning: Branch condition evaluates
  to a garbage value
        if (!req.service_path[0])
            ^~~~~~~~~~~~~~~~~~~~

This check that req.service_path was set in an earlier loop.
However req is a stack variable and its initial value
is undefined.

So initialize req to 0.

Fixes: fbe639b44a82 ("soc: qcom: Introduce Protection Domain Restart helpers")
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Signed-off-by: Tom Rix <trix@redhat.com>
Link: https://lore.kernel.org/r/20200819184637.15648-1-trix@redhat.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/qcom/pdr_interface.c