ovl: check ERR_PTR() return value from ovl_lookup_real()

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 0617015403 ("ovl: lookup indexed ancestor of lower dir")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
This commit is contained in:
Amir Goldstein 2018-01-30 14:30:50 +02:00 committed by Miklos Szeredi
parent 2ca3c148a0
commit 7168179fcf
1 changed files with 2 additions and 2 deletions

View File

@ -477,8 +477,8 @@ static struct dentry *ovl_lookup_real_inode(struct super_block *sb,
dput(upper);
}
if (!this)
return NULL;
if (IS_ERR_OR_NULL(this))
return this;
if (WARN_ON(ovl_dentry_real_at(this, layer->idx) != real)) {
dput(this);