From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [patch] VFS: collect_mounts() should return an ERR_PTR Date: Wed, 14 Aug 2013 12:44:39 +0300 Message-ID: <20130814094439.GD521@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org To: Alexander Viro Return-path: Content-Disposition: inline Sender: kernel-janitors-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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. Cc: # 3.10+ Signed-off-by: Dan Carpenter diff --git a/fs/namespace.c b/fs/namespace.c index 9809084..f1c61bb 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -1429,7 +1429,7 @@ struct vfsmount *collect_mounts(struct path *path) CL_COPY_ALL | CL_PRIVATE); namespace_unlock(); if (IS_ERR(tree)) - return NULL; + return ERR_CAST(tree); return &tree->mnt; }