]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/lpfc/lpfc_debugfs.c
Merge branch 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / scsi / lpfc / lpfc_debugfs.c
index c7d1c9d37a64b6b16895841d4186eda9bf4106a4..4bcb92c844ca5f5061c8a4a5cdfb3d7835594162 100644 (file)
@@ -5866,8 +5866,10 @@ lpfc_debugfs_terminate(struct lpfc_vport *vport)
                        atomic_dec(&lpfc_debugfs_hba_count);
                }
 
-               debugfs_remove(lpfc_debugfs_root); /* lpfc */
-               lpfc_debugfs_root = NULL;
+               if (atomic_read(&lpfc_debugfs_hba_count) == 0) {
+                       debugfs_remove(lpfc_debugfs_root); /* lpfc */
+                       lpfc_debugfs_root = NULL;
+               }
        }
 #endif
        return;