Skip to content

Commit

Permalink
rbd: fix a memory leak in rbd_get_client()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Elder authored and Sage Weil committed Feb 2, 2012
1 parent d8fb02a commit 97bb59a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 97bb59a

Please sign in to comment.