提交 7f62656b 编写于 作者: D Dan Carpenter 提交者: Al Viro

aio: checking for NULL instead of IS_ERR

alloc_anon_inode() returns an ERR_PTR(), it doesn't return NULL.

Fixes: 71ad7490 ('rework aio migrate pages to use aio fs')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 42a2d923
...@@ -163,8 +163,8 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) ...@@ -163,8 +163,8 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages)
struct file *file; struct file *file;
struct path path; struct path path;
struct inode *inode = alloc_anon_inode(aio_mnt->mnt_sb); struct inode *inode = alloc_anon_inode(aio_mnt->mnt_sb);
if (!inode) if (IS_ERR(inode))
return ERR_PTR(-ENOMEM); return ERR_CAST(inode);
inode->i_mapping->a_ops = &aio_ctx_aops; inode->i_mapping->a_ops = &aio_ctx_aops;
inode->i_mapping->private_data = ctx; inode->i_mapping->private_data = ctx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册