瀏覽代碼

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>
Amir Goldstein 7 年之前
父節點
當前提交
7168179fcf
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      fs/overlayfs/export.c

+ 2 - 2
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);