* [PATCH -next] fs/affs: fix return value check in affs_get_parent()
@ 2017-01-23 14:10 Wei Yongjun
0 siblings, 0 replies; only message in thread
From: Wei Yongjun @ 2017-01-23 14:10 UTC (permalink / raw)
To: Miklos Szeredi, Fabian Frederick, Andrew Morton, Al Viro,
Jan Kara, Boaz Harrosh
Cc: Wei Yongjun, linux-fsdevel
From: Wei Yongjun <weiyongjun1@huawei.com>
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")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
fs/affs/namei.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index a3df8a6..96dd1d0 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));
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-23 14:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-23 14:10 [PATCH -next] fs/affs: fix return value check in affs_get_parent() Wei Yongjun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).