CC: kbuild-all(a)lists.01.org TO: Murthy Bhat CC: "Martin K. Petersen" CC: Scott Benesh CC: Mike McGowen CC: Scott Teel CC: Kevin Barnett CC: Martin Wilck CC: Don Brace tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next head: 857a80bbd7321161f986588160d97815d1b1206a commit: ec504b23df9d33260602affc50389cf070707c9b [304/324] scsi: smartpqi: Add phy ID support for the physical drives :::::: branch date: 5 hours ago :::::: commit date: 7 hours ago config: i386-randconfig-m021-20210406 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/scsi/smartpqi/smartpqi_sas_transport.c:97 pqi_sas_port_add_rphy() warn: variable dereferenced before check 'pqi_sas_port->device' (see line 95) vim +97 drivers/scsi/smartpqi/smartpqi_sas_transport.c 6c223761eb5482 Kevin Barnett 2016-06-27 87 6c223761eb5482 Kevin Barnett 2016-06-27 88 static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port, 6c223761eb5482 Kevin Barnett 2016-06-27 89 struct sas_rphy *rphy) 6c223761eb5482 Kevin Barnett 2016-06-27 90 { 6c223761eb5482 Kevin Barnett 2016-06-27 91 struct sas_identify *identify; 6c223761eb5482 Kevin Barnett 2016-06-27 92 6c223761eb5482 Kevin Barnett 2016-06-27 93 identify = &rphy->identify; 6c223761eb5482 Kevin Barnett 2016-06-27 94 identify->sas_address = pqi_sas_port->sas_address; ec504b23df9d33 Murthy Bhat 2021-03-11 @95 identify->phy_identifier = pqi_sas_port->device->phy_id; 3d46a59a191e81 Don Brace 2018-12-07 96 3d46a59a191e81 Don Brace 2018-12-07 @97 if (pqi_sas_port->device && 3d46a59a191e81 Don Brace 2018-12-07 98 pqi_sas_port->device->is_expander_smp_device) { 3d46a59a191e81 Don Brace 2018-12-07 99 identify->initiator_port_protocols = SAS_PROTOCOL_SMP; 3d46a59a191e81 Don Brace 2018-12-07 100 identify->target_port_protocols = SAS_PROTOCOL_SMP; 3d46a59a191e81 Don Brace 2018-12-07 101 } else { 6c223761eb5482 Kevin Barnett 2016-06-27 102 identify->initiator_port_protocols = SAS_PROTOCOL_STP; 6c223761eb5482 Kevin Barnett 2016-06-27 103 identify->target_port_protocols = SAS_PROTOCOL_STP; 3d46a59a191e81 Don Brace 2018-12-07 104 } 6c223761eb5482 Kevin Barnett 2016-06-27 105 6c223761eb5482 Kevin Barnett 2016-06-27 106 return sas_rphy_add(rphy); 6c223761eb5482 Kevin Barnett 2016-06-27 107 } 6c223761eb5482 Kevin Barnett 2016-06-27 108 :::::: The code at line 97 was first introduced by commit :::::: 3d46a59a191e81f7ada771b8db71553916b851da scsi: smartpqi: add smp_utils support :::::: TO: Don Brace :::::: CC: Martin K. Petersen --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org