[SCSI] lpfc 8.3.44: Fixed incorrect allocation of iDiags directories/files in debugfs
authorJames Smart <james.smart@emulex.com>
Wed, 18 Dec 2013 01:29:59 +0000 (20:29 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Sat, 15 Mar 2014 17:18:55 +0000 (10:18 -0700)
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/lpfc/lpfc_debugfs.c

index b800cc952ca663477a87c34404a3f0a82c948d71..c3c3fbe4308316c2754682f99a419e6dc4d6da4e 100644 (file)
@@ -3927,6 +3927,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
        struct lpfc_hba   *phba = vport->phba;
        char name[64];
        uint32_t num, i;
+       bool pport_setup = false;
 
        if (!lpfc_debugfs_enable)
                return;
@@ -3947,6 +3948,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
        /* Setup funcX directory for specific HBA PCI function */
        snprintf(name, sizeof(name), "fn%d", phba->brd_no);
        if (!phba->hba_debugfs_root) {
+               pport_setup = true;
                phba->hba_debugfs_root =
                        debugfs_create_dir(name, lpfc_debugfs_root);
                if (!phba->hba_debugfs_root) {
@@ -4238,6 +4240,14 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
                goto debug_failed;
        }
 
+       /*
+        * The following section is for additional directories/files for the
+        * physical port.
+        */
+
+       if (!pport_setup)
+               goto debug_failed;
+
        /*
         * iDiag debugfs root entry points for SLI4 device only
         */