* [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session()
@ 2021-06-17 6:17 Nathan Chancellor
2021-06-18 22:52 ` James Smart
2021-06-19 2:31 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2021-06-17 6:17 UTC (permalink / raw)
To: James Smart, Ram Vegesna, James E.J. Bottomley, Martin K. Petersen
Cc: Nick Desaulniers, linux-scsi, target-devel, linux-kernel,
clang-built-linux, Nathan Chancellor
clang warns:
drivers/scsi/elx/efct/efct_lio.c:1216:24: warning: variable 'id' is
uninitialized when used here [-Wuninitialized]
se_sess, node, id);
^~
Shuffle the debug print after id's initialization so that the actual
value is printed.
Fixes: 692e5d73a811 ("scsi: elx: efct: LIO backend interface routines")
Link: https://github.com/ClangBuiltLinux/linux/issues/1397
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/scsi/elx/efct/efct_lio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c
index e1bab2b17e4d..b7d69ff29c09 100644
--- a/drivers/scsi/elx/efct/efct_lio.c
+++ b/drivers/scsi/elx/efct/efct_lio.c
@@ -1212,12 +1212,12 @@ static void efct_lio_setup_session(struct work_struct *work)
return;
}
- efc_log_debug(efct, "new initiator sess=%p node=%p id: %llx\n",
- se_sess, node, id);
-
tgt_node = node->tgt_node;
id = (u64) tgt_node->port_fc_id << 32 | tgt_node->node_fc_id;
+ efc_log_debug(efct, "new initiator sess=%p node=%p id: %llx\n",
+ se_sess, node, id);
+
if (xa_err(xa_store(&efct->lookup, id, tgt_node, GFP_KERNEL)))
efc_log_err(efct, "Node lookup store failed\n");
base-commit: ebc076b3eddc807729bd81f7bc48e798a3ddc477
--
2.32.0.93.g670b81a890
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session()
2021-06-17 6:17 [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session() Nathan Chancellor
@ 2021-06-18 22:52 ` James Smart
2021-06-19 2:31 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: James Smart @ 2021-06-18 22:52 UTC (permalink / raw)
To: Nathan Chancellor, James Smart, Ram Vegesna,
James E.J. Bottomley, Martin K. Petersen
Cc: Nick Desaulniers, linux-scsi, target-devel, linux-kernel,
clang-built-linux
On 6/16/2021 11:17 PM, Nathan Chancellor wrote:
> clang warns:
>
> drivers/scsi/elx/efct/efct_lio.c:1216:24: warning: variable 'id' is
> uninitialized when used here [-Wuninitialized]
> se_sess, node, id);
> ^~
>
> Shuffle the debug print after id's initialization so that the actual
> value is printed.
>
> Fixes: 692e5d73a811 ("scsi: elx: efct: LIO backend interface routines")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1397
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/scsi/elx/efct/efct_lio.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
Thanks
Reviewed-by: James Smart <jsmart2021@gmail.com>
-- james
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session()
2021-06-17 6:17 [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session() Nathan Chancellor
2021-06-18 22:52 ` James Smart
@ 2021-06-19 2:31 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-19 2:31 UTC (permalink / raw)
To: Nathan Chancellor
Cc: James Smart, Ram Vegesna, James E.J. Bottomley,
Martin K. Petersen, Nick Desaulniers, linux-scsi, target-devel,
linux-kernel, clang-built-linux
Nathan,
> clang warns:
>
> drivers/scsi/elx/efct/efct_lio.c:1216:24: warning: variable 'id' is
> uninitialized when used here [-Wuninitialized]
> se_sess, node, id);
> ^~
>
> Shuffle the debug print after id's initialization so that the actual
> value is printed.
Applied to 5.14/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-19 2:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-17 6:17 [PATCH] scsi: elx: efct: Do not use id uninitialized in efct_lio_setup_session() Nathan Chancellor
2021-06-18 22:52 ` James Smart
2021-06-19 2:31 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).