diff options
-rw-r--r-- | fs/debugfs/inode.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 0662ba6de85a..d22438ef7674 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
@@ -403,6 +403,7 @@ void debugfs_remove_recursive(struct dentry *dentry) | |||
403 | } | 403 | } |
404 | child = list_entry(parent->d_subdirs.next, struct dentry, | 404 | child = list_entry(parent->d_subdirs.next, struct dentry, |
405 | d_u.d_child); | 405 | d_u.d_child); |
406 | next_sibling: | ||
406 | 407 | ||
407 | /* | 408 | /* |
408 | * If "child" isn't empty, walk down the tree and | 409 | * If "child" isn't empty, walk down the tree and |
@@ -417,6 +418,16 @@ void debugfs_remove_recursive(struct dentry *dentry) | |||
417 | __debugfs_remove(child, parent); | 418 | __debugfs_remove(child, parent); |
418 | if (parent->d_subdirs.next == &child->d_u.d_child) { | 419 | if (parent->d_subdirs.next == &child->d_u.d_child) { |
419 | /* | 420 | /* |
421 | * Try the next sibling. | ||
422 | */ | ||
423 | if (child->d_u.d_child.next != &parent->d_subdirs) { | ||
424 | child = list_entry(child->d_u.d_child.next, | ||
425 | struct dentry, | ||
426 | d_u.d_child); | ||
427 | goto next_sibling; | ||
428 | } | ||
429 | |||
430 | /* | ||
420 | * Avoid infinite loop if we fail to remove | 431 | * Avoid infinite loop if we fail to remove |
421 | * one dentry. | 432 | * one dentry. |
422 | */ | 433 | */ |