From: Richard Weinberger Date: Wed, 29 Oct 2014 21:50:53 +0000 (-0700) Subject: ocfs2: fix d_splice_alias() return code checking X-Git-Tag: v3.18-rc3~31^2~4 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=d3556babd7facb8fbc596bada0d67139e3b22330;p=~emulex%2Finfiniband.git ocfs2: fix d_splice_alias() return code checking d_splice_alias() can return a valid dentry, NULL or an ERR_PTR. Currently the code checks not for ERR_PTR and will cuase an oops in ocfs2_dentry_attach_lock(). Fix this by using IS_ERR_OR_NULL(). Signed-off-by: Richard Weinberger Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 8add6f1030d..b931e04e338 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -158,7 +158,7 @@ bail_add: * NOTE: This dentry already has ->d_op set from * ocfs2_get_parent() and ocfs2_get_dentry() */ - if (ret) + if (!IS_ERR_OR_NULL(ret)) dentry = ret; status = ocfs2_dentry_attach_lock(dentry, inode,