Skip to content

Commit

Permalink
rbd: null vs ERR_PTR
Browse files Browse the repository at this point in the history
ceph_alloc_page_vector() returns ERR_PTR(-ENOMEM) on errors.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Dan Carpenter authored and Sage Weil committed Oct 20, 2010
1 parent 240634e commit b8d0638
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,8 @@ static int rbd_req_sync_op(struct rbd_device *dev,

num_pages = calc_pages_for(ofs , len);
pages = ceph_alloc_page_vector(num_pages, GFP_KERNEL);
if (!pages)
return -ENOMEM;
if (IS_ERR(pages))
return PTR_ERR(pages);

if (!orig_ops) {
payload_len = (flags & CEPH_OSD_FLAG_WRITE ? len : 0);
Expand Down

0 comments on commit b8d0638

Please sign in to comment.