lkml.org 
[lkml]   [2013]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] aio: checking for NULL instead of IS_ERR
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."


\
 
 \ /
  Last update: 2013-11-13 18:41    [W:0.125 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site