rbd: fix leak of ops struct
authorSage Weil <sage@newdream.net>
Thu, 12 May 2011 23:13:54 +0000 (16:13 -0700)
committerSage Weil <sage@newdream.net>
Fri, 13 May 2011 03:59:14 +0000 (20:59 -0700)
The ops vector must be freed by the rbd_do_request caller.

Signed-off-by: Sage Weil <sage@newdream.net>
drivers/block/rbd.c

index 3e904717c1c05f4dee56e040f9bf7df2faf57ce1..2146cab1c61be3769c5b5792bffad0da922703db 100644 (file)
@@ -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;
@@ -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;