From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Fabian Frederick <fabf@skynet.be>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Boaz Harrosh <ooo@electrozaur.com>,
Miklos Szeredi <mszeredi@redhat.com>,
linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] fs/affs: affs_bread() doesn't return ERR_PTRs
Date: Sat, 21 Jan 2017 04:48:19 +0000 [thread overview]
Message-ID: <20170121044819.GA15269@mwanda> (raw)
We're checking IS_ERR() here, but we should be checking for NULL.
Fixes: e393e82a7d09 ("fs/affs: make export work with cold dcache")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index a3df8a6..706dd06 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));
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Fabian Frederick <fabf@skynet.be>
Cc: Al Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
Boaz Harrosh <ooo@electrozaur.com>,
Miklos Szeredi <mszeredi@redhat.com>,
linux-fsdevel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] fs/affs: affs_bread() doesn't return ERR_PTRs
Date: Sat, 21 Jan 2017 07:48:19 +0300 [thread overview]
Message-ID: <20170121044819.GA15269@mwanda> (raw)
We're checking IS_ERR() here, but we should be checking for NULL.
Fixes: e393e82a7d09 ("fs/affs: make export work with cold dcache")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index a3df8a6..706dd06 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));
next reply other threads:[~2017-01-21 4:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-21 4:48 Dan Carpenter [this message]
2017-01-21 4:48 ` [patch] fs/affs: affs_bread() doesn't return ERR_PTRs Dan Carpenter
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=20170121044819.GA15269@mwanda \
--to=dan.carpenter@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=jack@suse.cz \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=ooo@electrozaur.com \
--cc=viro@zeniv.linux.org.uk \
/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.