From: Dan Carpenter <dan.carpenter@oracle.com> To: Trond Myklebust <trond.myklebust@primarydata.com>, Anna Schumaker <Anna.Schumaker@Netapp.com> Cc: linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] NFS: checking for NULL instead of IS_ERR() in nfs_commit_file() Date: Mon, 23 May 2016 10:21:01 +0000 [thread overview] Message-ID: <20160523102101.GC10712@mwanda> (raw) 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> diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 4dac51b..54a4eb6 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; }
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com> To: Trond Myklebust <trond.myklebust@primarydata.com>, Anna Schumaker <Anna.Schumaker@Netapp.com> Cc: linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] NFS: checking for NULL instead of IS_ERR() in nfs_commit_file() Date: Mon, 23 May 2016 13:21:01 +0300 [thread overview] Message-ID: <20160523102101.GC10712@mwanda> (raw) 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> diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 4dac51b..54a4eb6 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; }
next reply other threads:[~2016-05-23 10:21 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-05-23 10:21 Dan Carpenter [this message] 2016-05-23 10:21 ` [patch] NFS: checking for NULL instead of IS_ERR() in nfs_commit_file() Dan Carpenter
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20160523102101.GC10712@mwanda \ --to=dan.carpenter@oracle.com \ --cc=Anna.Schumaker@Netapp.com \ --cc=kernel-janitors@vger.kernel.org \ --cc=linux-nfs@vger.kernel.org \ --cc=trond.myklebust@primarydata.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.