Commit dab6c838 authored by Wei Yongjun's avatar Wei Yongjun Committed by Greg Kroah-Hartman

libceph: fix return value check in alloc_msg_with_page_vector()

commit c22e853a 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: 19079203 ('libceph: support for sending notifies')
Signed-off-by: default avatarWei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0c157dba
...@@ -4187,7 +4187,7 @@ static struct ceph_msg *alloc_msg_with_page_vector(struct ceph_msg_header *hdr) ...@@ -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), pages = ceph_alloc_page_vector(calc_pages_for(0, data_len),
GFP_NOIO); GFP_NOIO);
if (!pages) { if (IS_ERR(pages)) {
ceph_msg_put(m); ceph_msg_put(m);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment