Hello Himanshu,
The latest smatch version reports a large number of warnings about
uninitialized variables for the qla2xxx driver. I think these warnings
indicate real bugs. Can you have a look at these warnings?
Thanks,
Bart.
$ make M=drivers/scsi/qla2xxx C=2 CHECK="smatch -p=kernel"
CHECK drivers/scsi/qla2xxx/qla_os.c
CC [M] drivers/scsi/qla2xxx/qla_os.o
CHECK drivers/scsi/qla2xxx/qla_init.c
CC [M] drivers/scsi/qla2xxx/qla_init.o
CHECK drivers/scsi/qla2xxx/qla_mbx.c
CC [M] drivers/scsi/qla2xxx/qla_mbx.o
CHECK drivers/scsi/qla2xxx/qla_iocb.c
CC [M] drivers/scsi/qla2xxx/qla_iocb.o
CHECK drivers/scsi/qla2xxx/qla_isr.c
CC [M] drivers/scsi/qla2xxx/qla_isr.o
CHECK drivers/scsi/qla2xxx/qla_gs.c
CC [M] drivers/scsi/qla2xxx/qla_gs.o
CHECK drivers/scsi/qla2xxx/qla_dbg.c
CC [M] drivers/scsi/qla2xxx/qla_dbg.o
CHECK drivers/scsi/qla2xxx/qla_sup.c
CC [M] drivers/scsi/qla2xxx/qla_sup.o
CHECK drivers/scsi/qla2xxx/qla_attr.c
CC [M] drivers/scsi/qla2xxx/qla_attr.o
CHECK drivers/scsi/qla2xxx/qla_mid.c
CC [M] drivers/scsi/qla2xxx/qla_mid.o
CHECK drivers/scsi/qla2xxx/qla_dfs.c
CC [M] drivers/scsi/qla2xxx/qla_dfs.o
CHECK drivers/scsi/qla2xxx/qla_bsg.c
CC [M] drivers/scsi/qla2xxx/qla_bsg.o
CHECK drivers/scsi/qla2xxx/qla_nx.c
drivers/scsi/qla2xxx/qla_nx.c:1016: qla82xx_flash_wait_write_finish()
error: uninitialized symbol 'val'.
drivers/scsi/qla2xxx/qla_nx.c:1213: qla82xx_pinit_from_rom() error:
uninitialized symbol 'n'.
CC [M] drivers/scsi/qla2xxx/qla_nx.o
CHECK drivers/scsi/qla2xxx/qla_mr.c
drivers/scsi/qla2xxx/qla_mr.c:2268: qlafx00_ioctl_iosb_entry() error:
uninitialized symbol 'res'.
CC [M] drivers/scsi/qla2xxx/qla_mr.o
drivers/scsi/qla2xxx/qla_mr.c: In function ‘qlafx00_fx_disc’:
drivers/scsi/qla2xxx/qla_mr.c:1882:4: warning: ‘strncpy’ output may be
truncated copying 64 bytes from a string of length 64
[-Wstringop-truncation]
strncpy(phost_info->nodename,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p_sysid->nodename, NODENAME_LENGTH);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/qla2xxx/qla_mr.c:1886:4: warning: ‘strncpy’ output may be
truncated copying 64 bytes from a string of length 64
[-Wstringop-truncation]
strncpy(phost_info->release,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
p_sysid->release, RELEASE_LENGTH);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/qla2xxx/qla_mr.c:1888:4: warning: ‘strncpy’ output may be
truncated copying 64 bytes from a string of length 64
[-Wstringop-truncation]
strncpy(phost_info->version,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
p_sysid->version, VERSION_LENGTH);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/qla2xxx/qla_mr.c:1890:4: warning: ‘strncpy’ output may be
truncated copying 64 bytes from a string of length 64
[-Wstringop-truncation]
strncpy(phost_info->machine,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
p_sysid->machine, MACHINE_LENGTH);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/qla2xxx/qla_mr.c:1892:4: warning: ‘strncpy’ output may be
truncated copying 64 bytes from a string of length 64
[-Wstringop-truncation]
strncpy(phost_info->domainname,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p_sysid->domainname, DOMNAME_LENGTH);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CHECK drivers/scsi/qla2xxx/qla_nx2.c
drivers/scsi/qla2xxx/qla_nx2.c:135: qla8044_read_write_crb_reg() error:
uninitialized symbol 'value'.
drivers/scsi/qla2xxx/qla_nx2.c:149: qla8044_poll_wait_for_ready() error:
uninitialized symbol 'temp'.
drivers/scsi/qla2xxx/qla_nx2.c:678: qla8044_poll_reg() error:
uninitialized symbol 'value'.
drivers/scsi/qla2xxx/qla_nx2.c:697: qla8044_poll_reg() error:
uninitialized symbol 'value'.
drivers/scsi/qla2xxx/qla_nx2.c:921: qla8044_poll_read_list() error:
uninitialized symbol 'value'.
drivers/scsi/qla2xxx/qla_nx2.c:1193: qla8044_ms_mem_write_128b() error:
uninitialized symbol 'agt_ctrl'.
drivers/scsi/qla2xxx/qla_nx2.c:2235: qla8044_minidump_process_control()
error: uninitialized symbol 'read_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2261: qla8044_minidump_process_control()
error: uninitialized symbol 'read_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2286: qla8044_minidump_process_control()
error: uninitialized symbol 'read_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2344: qla8044_minidump_process_rdcrb()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2413: qla8044_minidump_process_rdmem()
error: uninitialized symbol 'r_data'.
drivers/scsi/qla2xxx/qla_nx2.c:2507: qla8044_minidump_process_l2tag()
error: uninitialized symbol 'c_value_r'.
drivers/scsi/qla2xxx/qla_nx2.c:2519: qla8044_minidump_process_l2tag()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2554: qla8044_minidump_process_l1cache()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2615: qla8044_minidump_process_rdmux()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2644: qla8044_minidump_process_queue()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2677: qla8044_minidump_process_pollrd()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:2726: qla8044_minidump_process_rdmux2()
error: uninitialized symbol 'data'.
drivers/scsi/qla2xxx/qla_nx2.c:2767:
qla8044_minidump_process_pollrdmwr() error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:3034: qla8044_minidump_process_rddfe()
error: uninitialized symbol 'temp'.
drivers/scsi/qla2xxx/qla_nx2.c:3084: qla8044_minidump_process_rddfe()
error: uninitialized symbol 'data'.
drivers/scsi/qla2xxx/qla_nx2.c:3193: qla8044_minidump_process_pollwr()
error: uninitialized symbol 'r_value'.
drivers/scsi/qla2xxx/qla_nx2.c:3713: qla8044_write_flash_buffer_mode()
error: uninitialized symbol 'spi_val'.
CC [M] drivers/scsi/qla2xxx/qla_nx2.o
CHECK drivers/scsi/qla2xxx/qla_target.c
./arch/x86/include/asm/refcount.h:92: refcount_add_not_zero() warn:
signed overflow undefined. 'c + i < c'
drivers/scsi/qla2xxx/qla_target.c:1750: qlt_24xx_send_abts_resp() warn:
'*&f_ctl' 10027008 can't fit into 255 '*p'
CC [M] drivers/scsi/qla2xxx/qla_target.o
CHECK drivers/scsi/qla2xxx/qla_tmpl.c
CC [M] drivers/scsi/qla2xxx/qla_tmpl.o
CHECK drivers/scsi/qla2xxx/qla_nvme.c
CC [M] drivers/scsi/qla2xxx/qla_nvme.o
LD [M] drivers/scsi/qla2xxx/qla2xxx.o
CHECK drivers/scsi/qla2xxx/tcm_qla2xxx.c
CC [M] drivers/scsi/qla2xxx/tcm_qla2xxx.o
Building modules, stage 2.
MODPOST 2 modules
CC drivers/scsi/qla2xxx/qla2xxx.mod.o
LD [M] drivers/scsi/qla2xxx/qla2xxx.ko
CC drivers/scsi/qla2xxx/tcm_qla2xxx.mod.o
LD [M] drivers/scsi/qla2xxx/tcm_qla2xxx.ko