mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: trix@redhat.com
Cc: Nilesh Javali <njavali@marvell.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	natechancellor@gmail.com, ndesaulniers@google.com,
	GR-QLogic-Storage-Upstream@marvell.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com
Subject: Re: [PATCH] scsi: qla2xxx: initialize value
Date: Wed, 7 Oct 2020 08:32:42 -0500	[thread overview]
Message-ID: <2E536F63-9F97-4B80-8538-D3176650CC70@oracle.com> (raw)
In-Reply-To: <20201005144544.25335-1-trix@redhat.com>



> On Oct 5, 2020, at 9:45 AM, trix@redhat.com wrote:
> 
> From: Tom Rix <trix@redhat.com>
> 
> clang static analysis reports this problem:
> 
> qla_nx2.c:694:3: warning: 6th function call argument is
>  an uninitialized value
>        ql_log(ql_log_fatal, vha, 0xb090,
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> In qla8044_poll_reg(), when reading the reg fails, the
> error is reported by reusing the timeout error reporter.
> Because the value is unset, a garbage value will be
> reported.  So initialize the value.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/scsi/qla2xxx/qla_nx2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nx2.c b/drivers/scsi/qla2xxx/qla_nx2.c
> index 3a415b12dcec..01ccd4526707 100644
> --- a/drivers/scsi/qla2xxx/qla_nx2.c
> +++ b/drivers/scsi/qla2xxx/qla_nx2.c
> @@ -659,7 +659,7 @@ static int
> qla8044_poll_reg(struct scsi_qla_host *vha, uint32_t addr,
> 	int duration, uint32_t test_mask, uint32_t test_result)
> {
> -	uint32_t value;
> +	uint32_t value = 0;
> 	int timeout_error;
> 	uint8_t retries;
> 	int ret_val = QLA_SUCCESS;
> -- 
> 2.18.1
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


  reply	other threads:[~2020-10-07 13:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 14:45 trix
2020-10-07 13:32 ` Himanshu Madhani [this message]
2020-10-08  2:21 ` Martin K. Petersen
2020-10-13 22:43 ` Martin K. Petersen

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=2E536F63-9F97-4B80-8538-D3176650CC70@oracle.com \
    --to=himanshu.madhani@oracle.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.com \
    --cc=njavali@marvell.com \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®