From: trix@redhat.com
To: njavali@marvell.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, natechancellor@gmail.com,
ndesaulniers@google.com
Cc: GR-QLogic-Storage-Upstream@marvell.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
clang-built-linux@googlegroups.com, Tom Rix <trix@redhat.com>
Subject: [PATCH] scsi: qla2xxx: initialize value
Date: Mon, 5 Oct 2020 07:45:44 -0700 [thread overview]
Message-ID: <20201005144544.25335-1-trix@redhat.com> (raw)
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
next reply other threads:[~2020-10-05 14:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 14:45 trix [this message]
2020-10-07 13:32 ` [PATCH] scsi: qla2xxx: initialize value Himanshu Madhani
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=20201005144544.25335-1-trix@redhat.com \
--to=trix@redhat.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 \
/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