From 2997bfd0492d33d230b1475909a0211157a734bc Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 23 May 2016 13:21:01 +0300 Subject: [PATCH] NFS: checking for NULL instead of IS_ERR() in nfs_commit_file() nfs_create_request() doesn't return NULL, it returns error pointers. Fixes: 67911c8f18b5 ('NFS: Add nfs_commit_file()') Signed-off-by: Dan Carpenter Signed-off-by: Anna Schumaker --- fs/nfs/write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 4dac51ba1f7e..54a4eb6bc462 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1735,8 +1735,8 @@ int nfs_commit_file(struct file *file, struct nfs_write_verifier *verf) open = get_nfs_open_context(nfs_file_open_context(file)); req = nfs_create_request(open, NULL, NULL, 0, i_size_read(inode)); - if (!req) { - ret = -ENOMEM; + if (IS_ERR(req)) { + ret = PTR_ERR(req); goto out_put; } -- 2.30.2