Skip to content

Commit a161ffe

Browse files
Tom Rixandersson
authored andcommitted
soc: qcom: initialize local variable
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: fbe639b ("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>
1 parent 903b083 commit a161ffe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/soc/qcom/pdr_interface.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ EXPORT_SYMBOL(pdr_add_lookup);
569569
int pdr_restart_pd(struct pdr_handle *pdr, struct pdr_service *pds)
570570
{
571571
struct servreg_restart_pd_resp resp;
572-
struct servreg_restart_pd_req req;
572+
struct servreg_restart_pd_req req = { 0 };
573573
struct sockaddr_qrtr addr;
574574
struct pdr_service *tmp;
575575
struct qmi_txn txn;

0 commit comments

Comments
 (0)