1
0
Fork 0

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: 1907920324 ('libceph: support for sending notifies')
Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
hifive-unleashed-5.1
Wei Yongjun 2016-07-30 00:37:57 +00:00 committed by Ilya Dryomov
parent 29b4817d40
commit c22e853a2e
1 changed files with 1 additions and 1 deletions

View File

@ -4220,7 +4220,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;
}