Explorar o código

VFS: collect_mounts() should return an ERR_PTR

This should actually be returning an ERR_PTR on error instead of NULL.
That was how it was designed and all the callers expect it.

[AV: actually, that's what "VFS: Make clone_mnt()/copy_tree()/collect_mounts()
return errors" missed - originally collect_mounts() was expected to return
NULL on failure]

Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Dan Carpenter %!s(int64=12) %!d(string=hai) anos
pai
achega
52e220d357
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      fs/namespace.c

+ 1 - 1
fs/namespace.c

@@ -1429,7 +1429,7 @@ struct vfsmount *collect_mounts(struct path *path)
 			 CL_COPY_ALL | CL_PRIVATE);
 			 CL_COPY_ALL | CL_PRIVATE);
 	namespace_unlock();
 	namespace_unlock();
 	if (IS_ERR(tree))
 	if (IS_ERR(tree))
-		return NULL;
+		return ERR_CAST(tree);
 	return &tree->mnt;
 	return &tree->mnt;
 }
 }