rbd: fix a memory leak in rbd_get_client()
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>
This commit is contained in:
@@ -380,6 +380,7 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr,
|
|||||||
rbdc = __rbd_client_find(opt);
|
rbdc = __rbd_client_find(opt);
|
||||||
if (rbdc) {
|
if (rbdc) {
|
||||||
ceph_destroy_options(opt);
|
ceph_destroy_options(opt);
|
||||||
|
kfree(rbd_opts);
|
||||||
|
|
||||||
/* using an existing client */
|
/* using an existing client */
|
||||||
kref_get(&rbdc->kref);
|
kref_get(&rbdc->kref);
|
||||||
|
Reference in New Issue
Block a user