summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2017-02-08 10:28:20 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-02-09 07:39:06 +1100
commit6e071f3e26baa4b76729ff712e867efd00f1f7d8 (patch)
tree7cfc70d96367e8ed18445682217ef32e1a62e15a /fs
parentfadac18996ec6ec9765af52fa924488706040716 (diff)
fs/affs: fix return value check in affs_get_parent()
In case of error, the function affs_bread() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: e393e82a7d09 ("fs/affs: make export work with cold dcache") Link: http://lkml.kernel.org/r/20170123141018.2331-1-weiyj.lk@gmail.com Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Cc: Fabian Frederick <fabf@skynet.be> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/affs/namei.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index a3df8a682a35..96dd1d09a273 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -453,8 +453,8 @@ static struct dentry *affs_get_parent(struct dentry *child)
struct buffer_head *bh;
bh = affs_bread(child->d_sb, d_inode(child)->i_ino);
- if (IS_ERR(bh))
- return ERR_CAST(bh);
+ if (!bh)
+ return ERR_PTR(-EIO);
parent = affs_iget(child->d_sb,
be32_to_cpu(AFFS_TAIL(child->d_sb, bh)->parent));