summaryrefslogtreecommitdiffstats
path: root/fs/omfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/omfs')
-rw-r--r--fs/omfs/dir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/omfs/dir.c b/fs/omfs/dir.c
index fd91f629ceb..de4ff29f1e0 100644
--- a/fs/omfs/dir.c
+++ b/fs/omfs/dir.c
@@ -361,9 +361,10 @@ static int omfs_fill_chain(struct file *filp, void *dirent, filldir_t filldir,
res = filldir(dirent, oi->i_name, strnlen(oi->i_name,
OMFS_NAMELEN), filp->f_pos, self, d_type);
- if (res == 0)
- filp->f_pos++;
brelse(bh);
+ if (res < 0)
+ break;
+ filp->f_pos++;
}
out:
return res;