From 8ecc363fa2e3c0f7690762fb3149d994b401d76d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 13 Nov 2013 10:49:40 +0300 Subject: [PATCH] aio: checking for NULL instead of IS_ERR alloc_anon_inode() returns an ERR_PTR(), it doesn't return NULL. Fixes: 8e6400f873f9 ('rework aio migrate pages to use aio fs') Signed-off-by: Dan Carpenter Signed-off-by: Al Viro --- fs/aio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 1f602d9be4c5b..823efcbb6ccd1 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -163,8 +163,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; -- 2.39.5