Skip to content

Commit

Permalink
libceph: fix ceph_osdc_alloc_request error checks
Browse files Browse the repository at this point in the history
ceph_osdc_alloc_request returns NULL on failure.

Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed May 3, 2011
1 parent 8c71897 commit 4ad1262
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,9 @@ static int rbd_do_request(struct request *rq,
ops,
false,
GFP_NOIO, pages, bio);
if (IS_ERR(req)) {
if (!req) {
up_read(&header->snap_rwsem);
ret = PTR_ERR(req);
ret = -ENOMEM;
goto done_pages;
}

Expand Down
4 changes: 2 additions & 2 deletions net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
snapc, ops,
use_mempool,
GFP_NOFS, NULL, NULL);
if (IS_ERR(req))
return req;
if (!req)
return NULL;

/* calculate max write size */
calc_layout(osdc, vino, layout, off, plen, req, ops);
Expand Down

0 comments on commit 4ad1262

Please sign in to comment.