Skip to content

Commit

Permalink
libceph: fix return value check in alloc_msg_with_page_vector()
Browse files Browse the repository at this point in the history
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: 1907920 ('libceph: support for sending notifies')
Signed-off-by: Wei Yongjun <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
weiyj authored and idryomov committed Aug 8, 2016
1 parent 29b4817 commit c22e853
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit c22e853

Please sign in to comment.