lpfc: Correct Port reset resulting in FC port going offline

Correct Port reset resulting in FC port going offline

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 6e11574..f4b3548 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -1595,9 +1595,10 @@
 		 * ready before performing reset.
 		 */
 		rc = lpfc_sli4_pdev_status_reg_wait(phba);
-		if (!rc)
+		if (rc)
 			return rc;
 	}
+
 	/* need reset: attempt for port recovery */
 	if (en_rn_msg)
 		lpfc_printf_log(phba, KERN_ERR, LOG_INIT,