aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-12 13:27:34 -0500
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-02-12 15:51:39 -0500
commitad6fef776927b4172e55a1bd97b3cd441a0c261c (patch)
treeed3438b4e7702c396e41c778b3fe7c195c6f8429
parenta4cb5bdb754afe21f3e9e7164213e8600cf69427 (diff)
rpc: properly check debugfs dentry before using it
debugfs can now report an error code if something went wrong instead of just NULL. So if the return value is to be used as a "real" dentry, it needs to be checked if it is an error before dereferencing it. This is now happening because of ff9fb72bc077 ("debugfs: return error values, not NULL"), but why debugfs files are not being created properly is an older issue, probably one that has always been there and should probably be looked at... Cc: "J. Bruce Fields" <bfields@fieldses.org> Cc: Jeff Layton <jlayton@kernel.org> Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org Reported-by: David Howells <dhowells@redhat.com> Tested-by: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
-rw-r--r--net/sunrpc/debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/debugfs.c b/net/sunrpc/debugfs.c
index 45a033329cd4..19bb356230ed 100644
--- a/net/sunrpc/debugfs.c
+++ b/net/sunrpc/debugfs.c
@@ -146,7 +146,7 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
146 rcu_read_lock(); 146 rcu_read_lock();
147 xprt = rcu_dereference(clnt->cl_xprt); 147 xprt = rcu_dereference(clnt->cl_xprt);
148 /* no "debugfs" dentry? Don't bother with the symlink. */ 148 /* no "debugfs" dentry? Don't bother with the symlink. */
149 if (!xprt->debugfs) { 149 if (IS_ERR_OR_NULL(xprt->debugfs)) {
150 rcu_read_unlock(); 150 rcu_read_unlock();
151 return; 151 return;
152 } 152 }