diff options
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/dir.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 610b5bdbe75b..61c42430cba3 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -430,10 +430,9 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) | |||
430 | i++; | 430 | i++; |
431 | /* fallthrough */ | 431 | /* fallthrough */ |
432 | default: | 432 | default: |
433 | if (filp->f_pos == 2) { | 433 | if (filp->f_pos == 2) |
434 | list_del(q); | 434 | list_move(q, &parent_sd->s_children); |
435 | list_add(q, &parent_sd->s_children); | 435 | |
436 | } | ||
437 | for (p=q->next; p!= &parent_sd->s_children; p=p->next) { | 436 | for (p=q->next; p!= &parent_sd->s_children; p=p->next) { |
438 | struct sysfs_dirent *next; | 437 | struct sysfs_dirent *next; |
439 | const char * name; | 438 | const char * name; |
@@ -455,8 +454,7 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) | |||
455 | dt_type(next)) < 0) | 454 | dt_type(next)) < 0) |
456 | return 0; | 455 | return 0; |
457 | 456 | ||
458 | list_del(q); | 457 | list_move(q, p); |
459 | list_add(q, p); | ||
460 | p = q; | 458 | p = q; |
461 | filp->f_pos++; | 459 | filp->f_pos++; |
462 | } | 460 | } |