LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Sibi Sankar <sibis@codeaurora.org>
To: trix@redhat.com
Cc: agross@kernel.org, bjorn.andersson@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-owner@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: initialize local variable
Date: Tue, 25 Aug 2020 12:57:47 +0530
Message-ID: <6cfe9537e007bb74a481a4caba2a4123@codeaurora.org> (raw)
In-Reply-To: <20200819184637.15648-1-trix@redhat.com>

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

> Signed-off-by: Tom Rix <trix@redhat.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.

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19 18:46 trix
2020-08-25  7:27 ` Sibi Sankar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6cfe9537e007bb74a481a4caba2a4123@codeaurora.org \
    --to=sibis@codeaurora.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel-owner@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trix@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git
	git clone --mirror https://lore.kernel.org/lkml/9 lkml/git/9.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git