summaryrefslogtreecommitdiff
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-01-30 14:30:50 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2018-02-16 15:53:20 +0100
commit7168179fcf25f7812e8541decac686a91359e522 (patch)
tree995efe6939761e96a4aa0b143b1345b45d63257a /fs/overlayfs
parent2ca3c148a06244d46dcfc95c5965644c83a30b37 (diff)
ovl: check ERR_PTR() return value from ovl_lookup_real()
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 061701540349 ("ovl: lookup indexed ancestor of lower dir") Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/export.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
index 9df455ca59a8..97a916ea8b86 100644
--- a/fs/overlayfs/export.c
+++ b/fs/overlayfs/export.c
@@ -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);