Skip to content

Commit

Permalink
aio: checking for NULL instead of IS_ERR
Browse files Browse the repository at this point in the history
alloc_anon_inode() returns an ERR_PTR(), it doesn't return NULL.

Fixes: 71ad749 ('rework aio migrate pages to use aio fs')
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Dan Carpenter authored and Al Viro committed Nov 13, 2013
1 parent 42a2d92 commit 7f62656
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7f62656

Please sign in to comment.