Skip to content

Commit

Permalink
NFS: checking for NULL instead of IS_ERR() in nfs_commit_file()
Browse files Browse the repository at this point in the history
nfs_create_request() doesn't return NULL, it returns error pointers.

Fixes: 67911c8 ('NFS: Add nfs_commit_file()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
  • Loading branch information
Dan Carpenter authored and Anna Schumaker committed May 25, 2016
1 parent 1b3c6d0 commit 2997bfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2997bfd

Please sign in to comment.