All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyj.lk@gmail.com>
To: Miklos Szeredi <mszeredi@redhat.com>,
	Fabian Frederick <fabf@skynet.be>,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Boaz Harrosh <ooo@electrozaur.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>, linux-fsdevel@vger.kernel.org
Subject: [PATCH -next] fs/affs: fix return value check in affs_get_parent()
Date: Mon, 23 Jan 2017 14:10:18 +0000	[thread overview]
Message-ID: <20170123141018.2331-1-weiyj.lk@gmail.com> (raw)

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));


                 reply	other threads:[~2017-01-23 14:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170123141018.2331-1-weiyj.lk@gmail.com \
    --to=weiyj.lk@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=fabf@skynet.be \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=ooo@electrozaur.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=weiyongjun1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.