From: Benjamin LaHaise <bcrl@kvack.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-aio@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] aio: checking for NULL instead of IS_ERR
Date: Wed, 13 Nov 2013 11:57:17 -0500 [thread overview]
Message-ID: <20131113165717.GB13840@kvack.org> (raw)
In-Reply-To: <20131113074940.GG25541@elgon.mountain>
On Wed, Nov 13, 2013 at 10:49:40AM +0300, Dan Carpenter wrote:
> alloc_anon_inode() returns an ERR_PTR(), it doesn't return NULL.
>
> Fixes: 71ad7490c1f3 ('rework aio migrate pages to use aio fs')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for spotting this.
Acked-by: Benjamin LaHaise <bcrl@kvack.org>
-ben
> diff --git a/fs/aio.c b/fs/aio.c
> index bf8d080..699f53e 100644
> --- a/fs/aio.c
> +++ b/fs/aio.c
> @@ -164,8 +164,8 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
> struct file *file;
> struct path path;
> struct inode *inode = alloc_anon_inode(aio_mnt->mnt_sb);
> - if (!inode)
> - return ERR_PTR(-ENOMEM);
> + if (IS_ERR(inode))
> + return ERR_CAST(inode);
>
> inode->i_mapping->a_ops = &aio_ctx_aops;
> inode->i_mapping->private_data = ctx;
--
"Thought is the essence of where you are now."
prev parent reply other threads:[~2013-11-13 16:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 7:49 [patch] aio: checking for NULL instead of IS_ERR Dan Carpenter
2013-11-13 12:29 ` Al Viro
2013-11-13 16:57 ` Benjamin LaHaise [this message]
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=20131113165717.GB13840@kvack.org \
--to=bcrl@kvack.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox