summaryrefslogtreecommitdiff
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 9ac1484a95a..bccd350a032 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -383,13 +383,15 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr,
spin_lock(&node_lock);
rbdc = __rbd_client_find(opt);
if (rbdc) {
- ceph_destroy_options(opt);
- kfree(rbd_opts);
-
/* using an existing client */
kref_get(&rbdc->kref);
- rbd_dev->rbd_client = rbdc;
spin_unlock(&node_lock);
+
+ rbd_dev->rbd_client = rbdc;
+
+ ceph_destroy_options(opt);
+ kfree(rbd_opts);
+
return 0;
}
spin_unlock(&node_lock);