|
@@ -449,13 +449,14 @@ static int ubifs_readdir(struct file *file, struct dir_context *ctx)
|
|
|
}
|
|
|
|
|
|
out:
|
|
|
+ kfree(file->private_data);
|
|
|
+ file->private_data = NULL;
|
|
|
+
|
|
|
if (err != -ENOENT) {
|
|
|
ubifs_err(c, "cannot find next direntry, error %d", err);
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
- kfree(file->private_data);
|
|
|
- file->private_data = NULL;
|
|
|
/* 2 is a special value indicating that there are no more direntries */
|
|
|
ctx->pos = 2;
|
|
|
return 0;
|