bfa: Fix to defer vport delete handler invocation till firmware logo response.
Hello Krishna Gudipati,
This is a semi-automatic email about new static checker warnings.
The patch 17c201b3281c: "[SCSI] bfa: Fix to defer vport delete handler invocation till firmware logo response." from Apr 9, 2012, leads to the following Smatch complaint:
drivers/scsi/bfa/bfa_fcs_lport.c:5725 bfa_fcs_vport_free()
warn: variable dereferenced before check 'vport_drv' (see line 5715)
drivers/scsi/bfa/bfa_fcs_lport.c
5714
5715 if (vport_drv->comp_del) {
^^^^^^^^^^^^^^^^^^^Old dereference.
5716 complete(vport_drv->comp_del);
5717 return;
5718 }
5719
5720 /*
5721 * We queue the vport delete work to the IM work_q from here.
5722 * The memory for the bfad_vport_s is freed from the FC function
5723 * template vport_delete entry point.
5724 */
5725 if (vport_drv)
^^^^^^^^^
New check.
5726 bfad_im_port_delete(vport_drv->drv_port.bfad,
5727 &vport_drv->drv_port);
regards,
dan carpenter