diff options
author | Sage Weil <sage@newdream.net> | 2011-05-03 12:23:36 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2011-05-03 12:28:13 -0400 |
commit | 4ad12621e442b7a072e81270808f617cb65c5672 (patch) | |
tree | eecdd1d51f525b9b07c70f8fbcf08c9ede3b8f79 | |
parent | 8c71897be2ddfd84969412635ca42fa9e137f7b6 (diff) |
libceph: fix ceph_osdc_alloc_request error checks
ceph_osdc_alloc_request returns NULL on failure.
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r-- | drivers/block/rbd.c | 4 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 16dc3645291c..3e904717c1c0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -777,9 +777,9 @@ static int rbd_do_request(struct request *rq, | |||
777 | ops, | 777 | ops, |
778 | false, | 778 | false, |
779 | GFP_NOIO, pages, bio); | 779 | GFP_NOIO, pages, bio); |
780 | if (IS_ERR(req)) { | 780 | if (!req) { |
781 | up_read(&header->snap_rwsem); | 781 | up_read(&header->snap_rwsem); |
782 | ret = PTR_ERR(req); | 782 | ret = -ENOMEM; |
783 | goto done_pages; | 783 | goto done_pages; |
784 | } | 784 | } |
785 | 785 | ||
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 5a80f41c0cba..6b5dda1cb5df 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -470,8 +470,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
470 | snapc, ops, | 470 | snapc, ops, |
471 | use_mempool, | 471 | use_mempool, |
472 | GFP_NOFS, NULL, NULL); | 472 | GFP_NOFS, NULL, NULL); |
473 | if (IS_ERR(req)) | 473 | if (!req) |
474 | return req; | 474 | return NULL; |
475 | 475 | ||
476 | /* calculate max write size */ | 476 | /* calculate max write size */ |
477 | calc_layout(osdc, vino, layout, off, plen, req, ops); | 477 | calc_layout(osdc, vino, layout, off, plen, req, ops); |