From b8d0638a98aa4a42ff322234b882487cd74e5c52 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 11 Oct 2010 21:14:23 +0200 Subject: [PATCH] rbd: null vs ERR_PTR ceph_alloc_page_vector() returns ERR_PTR(-ENOMEM) on errors. Signed-off-by: Dan Carpenter Signed-off-by: Sage Weil --- drivers/block/rbd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 1ac87f18205..52f9420704c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -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); -- 2.20.1