summaryrefslogtreecommitdiffstats
path: root/drivers/staging/erofs/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/erofs/dir.c')
-rw-r--r--drivers/staging/erofs/dir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
index 9bbc68729c11..dbf6a151886c 100644
--- a/drivers/staging/erofs/dir.c
+++ b/drivers/staging/erofs/dir.c
@@ -42,10 +42,9 @@ static int erofs_fill_dentries(struct dir_context *ctx,
void *dentry_blk, unsigned int *ofs,
unsigned int nameoff, unsigned int maxsize)
{
- struct erofs_dirent *de = dentry_blk;
+ struct erofs_dirent *de = dentry_blk + *ofs;
const struct erofs_dirent *end = dentry_blk + nameoff;
- de = dentry_blk + *ofs;
while (de < end) {
const char *de_name;
unsigned int de_namelen;