lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6cfe9537e007bb74a481a4caba2a4123@codeaurora.org>
Date:   Tue, 25 Aug 2020 12:57:47 +0530
From:   Sibi Sankar <sibis@...eaurora.org>
To:     trix@...hat.com
Cc:     agross@...nel.org, bjorn.andersson@...aro.org,
        linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-kernel-owner@...r.kernel.org
Subject: Re: [PATCH] soc: qcom: initialize local variable

On 2020-08-20 00:16, trix@...hat.com wrote:
> From: Tom Rix <trix@...hat.com>
> 
> 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")
> 

Tom,
Thanks for the patch.

Reviewed-by: Sibi Sankar <sibis@...eaurora.org>

> Signed-off-by: Tom Rix <trix@...hat.com>
> ---
>  drivers/soc/qcom/pdr_interface.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/pdr_interface.c 
> b/drivers/soc/qcom/pdr_interface.c
> index 088dc99f77f3..f63135c09667 100644
> --- a/drivers/soc/qcom/pdr_interface.c
> +++ b/drivers/soc/qcom/pdr_interface.c
> @@ -569,7 +569,7 @@ EXPORT_SYMBOL(pdr_add_lookup);
>  int pdr_restart_pd(struct pdr_handle *pdr, struct pdr_service *pds)
>  {
>  	struct servreg_restart_pd_resp resp;
> -	struct servreg_restart_pd_req req;
> +	struct servreg_restart_pd_req req = { 0 };
>  	struct sockaddr_qrtr addr;
>  	struct pdr_service *tmp;
>  	struct qmi_txn txn;

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ