linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] aio: checking for NULL instead of IS_ERR
@ 2013-11-13  7:49 Dan Carpenter
  2013-11-13 12:29 ` Al Viro
  2013-11-13 16:57 ` Benjamin LaHaise
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2013-11-13  7:49 UTC (permalink / raw)
  To: Benjamin LaHaise
  Cc: Alexander Viro, linux-aio, linux-fsdevel, linux-kernel,
	kernel-janitors

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>

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] aio: checking for NULL instead of IS_ERR
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2013-11-13 12:29 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Benjamin LaHaise, linux-aio, linux-fsdevel, linux-kernel,
	kernel-janitors

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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] aio: checking for NULL instead of IS_ERR
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin LaHaise @ 2013-11-13 16:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Alexander Viro, linux-aio, linux-fsdevel, linux-kernel,
	kernel-janitors

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."

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-13 16:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).