|
@@ -439,7 +439,7 @@ static unsigned int vfs_dent_type(uint8_t type)
|
|
|
*/
|
|
|
static int ubifs_readdir(struct file *file, struct dir_context *ctx)
|
|
|
{
|
|
|
- int err;
|
|
|
+ int err = 0;
|
|
|
struct qstr nm;
|
|
|
union ubifs_key key;
|
|
|
struct ubifs_dent_node *dent;
|
|
@@ -541,14 +541,12 @@ out:
|
|
|
kfree(file->private_data);
|
|
|
file->private_data = NULL;
|
|
|
|
|
|
- if (err != -ENOENT) {
|
|
|
+ if (err != -ENOENT)
|
|
|
ubifs_err(c, "cannot find next direntry, error %d", err);
|
|
|
- return err;
|
|
|
- }
|
|
|
|
|
|
/* 2 is a special value indicating that there are no more direntries */
|
|
|
ctx->pos = 2;
|
|
|
- return 0;
|
|
|
+ return err;
|
|
|
}
|
|
|
|
|
|
/* Free saved readdir() state when the directory is closed */
|