rbd: fix a memory leak in rbd_get_client()
authorAlex Elder <elder@dreamhost.com>
Tue, 24 Jan 2012 16:08:36 +0000 (10:08 -0600)
committerSage Weil <sage@newdream.net>
Thu, 2 Feb 2012 20:49:27 +0000 (12:49 -0800)
If an existing rbd client is found to be suitable for use in
rbd_get_client(), the rbd_options structure is not being
freed as it should.  Fix that.

Signed-off-by: Alex Elder <elder@dreamhost.com>
Signed-off-by: Sage Weil <sage@newdream.net>
drivers/block/rbd.c

index 148ab944378d57bdaec596e96bed6dc131777a28..7d8f8ddb33598803b108da53f275bd5feba78025 100644 (file)
@@ -380,6 +380,7 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr,
        rbdc = __rbd_client_find(opt);
        if (rbdc) {
                ceph_destroy_options(opt);
+               kfree(rbd_opts);
 
                /* using an existing client */
                kref_get(&rbdc->kref);