aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/sysfs/dir.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 158227e03b71..99ec5b40e977 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -990,13 +990,14 @@ static struct sysfs_dirent *sysfs_dir_next_pos(const void *ns,
990 struct sysfs_dirent *parent_sd, ino_t ino, struct sysfs_dirent *pos) 990 struct sysfs_dirent *parent_sd, ino_t ino, struct sysfs_dirent *pos)
991{ 991{
992 pos = sysfs_dir_pos(ns, parent_sd, ino, pos); 992 pos = sysfs_dir_pos(ns, parent_sd, ino, pos);
993 if (pos) do { 993 if (pos)
994 struct rb_node *node = rb_next(&pos->s_rb); 994 do {
995 if (!node) 995 struct rb_node *node = rb_next(&pos->s_rb);
996 pos = NULL; 996 if (!node)
997 else 997 pos = NULL;
998 pos = to_sysfs_dirent(node); 998 else
999 } while (pos && pos->s_ns != ns); 999 pos = to_sysfs_dirent(node);
1000 } while (pos && pos->s_ns != ns);
1000 return pos; 1001 return pos;
1001} 1002}
1002 1003