summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yongjun <weiyj.lk@gmail.com>2016-07-30 00:37:57 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-30 10:12:47 +0200
commitdab6c838065cac24e68ea0ae00970aa753d7b647 (patch)
treeb6ce1a2b72b0f272856df7630aeeb182c70edeee
parent0c157dba85e8b5713bbf23192b7640d8f30066b4 (diff)
downloadlwn-dab6c838065cac24e68ea0ae00970aa753d7b647.tar.gz
lwn-dab6c838065cac24e68ea0ae00970aa753d7b647.zip
libceph: fix return value check in alloc_msg_with_page_vector()
commit c22e853a2ed19321d00c1eae339ffdc4f5e7757e upstream. In case of error, the function ceph_alloc_page_vector() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: 1907920324f1 ('libceph: support for sending notifies') Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--net/ceph/osd_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index 89469592076c..aee117f831c6 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -4187,7 +4187,7 @@ static struct ceph_msg *alloc_msg_with_page_vector(struct ceph_msg_header *hdr)
pages = ceph_alloc_page_vector(calc_pages_for(0, data_len),
GFP_NOIO);
- if (!pages) {
+ if (IS_ERR(pages)) {
ceph_msg_put(m);
return NULL;
}