@@ -4755,6 +4755,16 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
47554755 if (!fcport )
47564756 return NULL ;
47574757
4758+ fcport -> ct_desc .ct_sns = dma_alloc_coherent (& vha -> hw -> pdev -> dev ,
4759+ sizeof (struct ct_sns_pkt ), & fcport -> ct_desc .ct_sns_dma ,
4760+ flags );
4761+ if (!fcport -> ct_desc .ct_sns ) {
4762+ ql_log (ql_log_warn , vha , 0xd049 ,
4763+ "Failed to allocate ct_sns request.\n" );
4764+ kfree (fcport );
4765+ return NULL ;
4766+ }
4767+
47584768 /* Setup fcport template structure. */
47594769 fcport -> vha = vha ;
47604770 fcport -> port_type = FCT_UNKNOWN ;
@@ -4763,13 +4773,11 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
47634773 fcport -> supported_classes = FC_COS_UNSPECIFIED ;
47644774 fcport -> fp_speed = PORT_SPEED_UNKNOWN ;
47654775
4766- fcport -> ct_desc .ct_sns = dma_alloc_coherent (& vha -> hw -> pdev -> dev ,
4767- sizeof (struct ct_sns_pkt ), & fcport -> ct_desc .ct_sns_dma ,
4768- flags );
47694776 fcport -> disc_state = DSC_DELETED ;
47704777 fcport -> fw_login_state = DSC_LS_PORT_UNAVAIL ;
47714778 fcport -> deleted = QLA_SESS_DELETED ;
47724779 fcport -> login_retry = vha -> hw -> login_retry_count ;
4780+ fcport -> chip_reset = vha -> hw -> base_qpair -> chip_reset ;
47734781 fcport -> logout_on_delete = 1 ;
47744782
47754783 if (!fcport -> ct_desc .ct_sns ) {
@@ -4778,6 +4786,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
47784786 kfree (fcport );
47794787 fcport = NULL ;
47804788 }
4789+
47814790 INIT_WORK (& fcport -> del_work , qla24xx_delete_sess_fn );
47824791 INIT_WORK (& fcport -> reg_work , qla_register_fcport_fn );
47834792 INIT_LIST_HEAD (& fcport -> gnl_entry );
0 commit comments