NFS: checking for NULL instead of IS_ERR() in nfs_commit_file()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 23 May 2016 10:21:01 +0000 (13:21 +0300)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 25 May 2016 16:11:58 +0000 (12:11 -0400)
nfs_create_request() doesn't return NULL, it returns error pointers.

Fixes: 67911c8f18b5 ('NFS: Add nfs_commit_file()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/write.c

index 4dac51ba1f7ea858eead8a1d002dce1d5bfaff39..54a4eb6bc46297d499d5bb1982c3e30be97e123b 100644 (file)
@@ -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;
        }
 
This page took 0.027849 seconds and 5 git commands to generate.