Skip to content

Commit

Permalink
ocfs2: fix d_splice_alias() return code checking
Browse files Browse the repository at this point in the history
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 <richard@nod.at>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
richardweinberger authored and torvalds committed Oct 29, 2014
1 parent 8186eb6 commit d3556ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ocfs2/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static struct dentry *ocfs2_lookup(struct inode *dir, struct dentry *dentry,
* 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,
Expand Down

0 comments on commit d3556ba

Please sign in to comment.