Răsfoiți Sursa

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 8 ani în urmă
părinte
comite
7168179fcf
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  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);