|
@@ -1020,6 +1020,8 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
|
|
ino = parent_sd->s_ino;
|
|
|
if (filldir(dirent, ".", 1, filp->f_pos, ino, DT_DIR) == 0)
|
|
|
filp->f_pos++;
|
|
|
+ else
|
|
|
+ return 0;
|
|
|
}
|
|
|
if (filp->f_pos == 1) {
|
|
|
if (parent_sd->s_parent)
|
|
@@ -1028,6 +1030,8 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
|
|
|
ino = parent_sd->s_ino;
|
|
|
if (filldir(dirent, "..", 2, filp->f_pos, ino, DT_DIR) == 0)
|
|
|
filp->f_pos++;
|
|
|
+ else
|
|
|
+ return 0;
|
|
|
}
|
|
|
mutex_lock(&sysfs_mutex);
|
|
|
for (pos = sysfs_dir_pos(ns, parent_sd, filp->f_pos, pos);
|