@@ -1827,22 +1827,20 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
1827
1827
fcoe_wwn_to_str (vport -> port_name , buf , sizeof (buf ));
1828
1828
QEDF_WARN (& (base_qedf -> dbg_ctx ), "Failed to create vport, "
1829
1829
"WWPN (0x%s) already exists.\n" , buf );
1830
- goto err1 ;
1830
+ return rc ;
1831
1831
}
1832
1832
1833
1833
if (atomic_read (& base_qedf -> link_state ) != QEDF_LINK_UP ) {
1834
1834
QEDF_WARN (& (base_qedf -> dbg_ctx ), "Cannot create vport "
1835
1835
"because link is not up.\n" );
1836
- rc = - EIO ;
1837
- goto err1 ;
1836
+ return - EIO ;
1838
1837
}
1839
1838
1840
1839
vn_port = libfc_vport_create (vport , sizeof (struct qedf_ctx ));
1841
1840
if (!vn_port ) {
1842
1841
QEDF_WARN (& (base_qedf -> dbg_ctx ), "Could not create lport "
1843
1842
"for vport.\n" );
1844
- rc = - ENOMEM ;
1845
- goto err1 ;
1843
+ return - ENOMEM ;
1846
1844
}
1847
1845
1848
1846
fcoe_wwn_to_str (vport -> port_name , buf , sizeof (buf ));
@@ -1866,7 +1864,7 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
1866
1864
if (rc ) {
1867
1865
QEDF_ERR (& (base_qedf -> dbg_ctx ), "Could not allocate memory "
1868
1866
"for lport stats.\n" );
1869
- goto err2 ;
1867
+ goto err ;
1870
1868
}
1871
1869
1872
1870
fc_set_wwnn (vn_port , vport -> node_name );
@@ -1884,7 +1882,7 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
1884
1882
if (rc ) {
1885
1883
QEDF_WARN (& base_qedf -> dbg_ctx ,
1886
1884
"Error adding Scsi_Host rc=0x%x.\n" , rc );
1887
- goto err2 ;
1885
+ goto err ;
1888
1886
}
1889
1887
1890
1888
/* Set default dev_loss_tmo based on module parameter */
@@ -1925,9 +1923,10 @@ static int qedf_vport_create(struct fc_vport *vport, bool disabled)
1925
1923
vport_qedf -> dbg_ctx .host_no = vn_port -> host -> host_no ;
1926
1924
vport_qedf -> dbg_ctx .pdev = base_qedf -> pdev ;
1927
1925
1928
- err2 :
1926
+ return 0 ;
1927
+
1928
+ err :
1929
1929
scsi_host_put (vn_port -> host );
1930
- err1 :
1931
1930
return rc ;
1932
1931
}
1933
1932
@@ -1968,8 +1967,7 @@ static int qedf_vport_destroy(struct fc_vport *vport)
1968
1967
fc_lport_free_stats (vn_port );
1969
1968
1970
1969
/* Release Scsi_Host */
1971
- if (vn_port -> host )
1972
- scsi_host_put (vn_port -> host );
1970
+ scsi_host_put (vn_port -> host );
1973
1971
1974
1972
out :
1975
1973
return 0 ;
0 commit comments