Skip to content

Commit

Permalink
rbd: fix leak of ops struct
Browse files Browse the repository at this point in the history
The ops vector must be freed by the rbd_do_request caller.

Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed May 13, 2011
1 parent 446cc63 commit 11f7700
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,8 @@ static int rbd_do_op(struct request *rq,
ops,
num_reply,
rbd_req_cb, 0, NULL);

rbd_destroy_ops(ops);
done:
kfree(seg_name);
return ret;
Expand Down Expand Up @@ -1063,7 +1065,9 @@ static int rbd_req_sync_notify_ack(struct rbd_device *dev,
{
struct ceph_osd_req_op *ops;
struct page **pages = NULL;
int ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_NOTIFY_ACK, 0);
int ret;

ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_NOTIFY_ACK, 0);
if (ret < 0)
return ret;

Expand Down

0 comments on commit 11f7700

Please sign in to comment.