Hello Hannes Reinecke,

The patch ee35624e1e4e: "scsi: libfc: Add lockdep annotations" from
Jul 4, 2018, leads to the following static checker warning:

        drivers/scsi/libfc/fc_rport.c:1838 fc_rport_recv_plogi_req()
        error: uninitialized symbol 'rdata'.

drivers/scsi/libfc/fc_rport.c
  1828  static void fc_rport_recv_plogi_req(struct fc_lport *lport,
  1829                                      struct fc_frame *rx_fp)
  1830  {
  1831          struct fc_disc *disc;
  1832          struct fc_rport_priv *rdata;
                                      ^^^^^
  1833          struct fc_frame *fp = rx_fp;
  1834          struct fc_els_flogi *pl;
  1835          struct fc_seq_els_data rjt_data;
  1836          u32 sid;
  1837  
  1838          lockdep_assert_held(&rdata->rp_mutex);
                                     ^^^^^^^^^^^^^^^
This isn't initialized.

  1839  
  1840          sid = fc_frame_sid(fp);
  1841  
  1842          FC_RPORT_ID_DBG(lport, sid, "Received PLOGI request\n");
  1843  
  1844          pl = fc_frame_payload_get(fp, sizeof(*pl));
  1845          if (!pl) {
  1846                  FC_RPORT_ID_DBG(lport, sid, "Received PLOGI too 
short\n");
  1847                  rjt_data.reason = ELS_RJT_PROT;
  1848                  rjt_data.explan = ELS_EXPL_INV_LEN;
  1849                  goto reject;
  1850          }
  1851  
  1852          disc = &lport->disc;
  1853          mutex_lock(&disc->disc_mutex);
  1854          rdata = fc_rport_create(lport, sid);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  1855          if (!rdata) {
                    ^^^^^^
  1856                  mutex_unlock(&disc->disc_mutex);
  1857                  rjt_data.reason = ELS_RJT_UNAB;
  1858                  rjt_data.explan = ELS_EXPL_INSUF_RES;
  1859                  goto reject;
  1860          }

regards,
dan carpenter

Reply via email to