scsi: qla2xxx: Initialize 'n' before using it
authorBart Van Assche <bvanassche@acm.org>
Mon, 29 Jun 2020 22:54:49 +0000 (15:54 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 1 Jul 2020 03:12:20 +0000 (23:12 -0400)
commit67668b5b13c7ba12f212d4b9067e54354ce5360b
tree47165fbe0bdad69deb49b7df02f5ac33aae86bbd
parent2f91a0a03c2da5140994d7b3d53469d07df9943c
scsi: qla2xxx: Initialize 'n' before using it

The following code:

qla82xx_rom_fast_read(ha, 0, &n)

only initializes 'n' if it succeeds. Since 'n' may be reported in a debug
message even if no ROM reads succeeded, initialize 'n' to zero.

This patch fixes the following sparse warning:

qla_nx.c:1218: qla82xx_pinit_from_rom() error: uninitialized symbol 'n'.

Link: https://lore.kernel.org/r/20200629225454.22863-5-bvanassche@acm.org
Cc: Nilesh Javali <njavali@marvell.com>
Cc: Quinn Tran <qutran@marvell.com>
Cc: Himanshu Madhani <himanshu.madhani@oracle.com>
Cc: Martin Wilck <mwilck@suse.com>
Cc: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Shyam Sundar <ssundar@marvell.com>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_nx.c