Re: [PATCH 4/9] qla2xxx: Initialize 'n' before using it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks good. 

Reviewed-by: Shyam Sundar <ssundar@xxxxxxxxxxx>

> On Jun 14, 2020, at 3:39 PM, Bart Van Assche <bvanassche@xxxxxxx> wrote:
> 
> 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'.
> 
> Cc: Nilesh Javali <njavali@xxxxxxxxxxx>
> Cc: Quinn Tran <qutran@xxxxxxxxxxx>
> Cc: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>
> Cc: Daniel Wagner <dwagner@xxxxxxx>
> Cc: Martin Wilck <mwilck@xxxxxxxx>
> Cc: Roman Bolshakov <r.bolshakov@xxxxxxxxx>
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
> ---
> drivers/scsi/qla2xxx/qla_nx.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
> index ff365b434a02..71273eb634d3 100644
> --- a/drivers/scsi/qla2xxx/qla_nx.c
> +++ b/drivers/scsi/qla2xxx/qla_nx.c
> @@ -1167,6 +1167,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha)
> 	 * Offset 4: Offset and number of addr/value pairs
> 	 * that present in CRB initialize sequence
> 	 */
> +	n = 0;
> 	if (qla82xx_rom_fast_read(ha, 0, &n) != 0 || n != 0xcafecafeUL ||
> 	    qla82xx_rom_fast_read(ha, 4, &n) != 0) {
> 		ql_log(ql_log_fatal, vha, 0x006e,





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux