diff options
author | Wei Yongjun <weiyj.lk@gmail.com> | 2016-07-29 20:37:57 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-08-08 15:41:41 -0400 |
commit | c22e853a2ed19321d00c1eae339ffdc4f5e7757e (patch) | |
tree | e490b26498c790a9dc06be590a974ea9dc231eb0 /net/ceph | |
parent | 29b4817d4018df78086157ea3a55c1d9424a7cfc (diff) |
libceph: fix return value check in alloc_msg_with_page_vector()
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>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/osd_client.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index b5ec09612ff7..a97e7b506612 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -4220,7 +4220,7 @@ static struct ceph_msg *alloc_msg_with_page_vector(struct ceph_msg_header *hdr) | |||
4220 | 4220 | ||
4221 | pages = ceph_alloc_page_vector(calc_pages_for(0, data_len), | 4221 | pages = ceph_alloc_page_vector(calc_pages_for(0, data_len), |
4222 | GFP_NOIO); | 4222 | GFP_NOIO); |
4223 | if (!pages) { | 4223 | if (IS_ERR(pages)) { |
4224 | ceph_msg_put(m); | 4224 | ceph_msg_put(m); |
4225 | return NULL; | 4225 | return NULL; |
4226 | } | 4226 | } |