ceph: handle errors during osd client init
Unwind initializing if we get ENOMEM during client initialization.
Signed-off-by: Sage Weil <sage@newdream.net>
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 1ac7b07..fe0a596 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -530,9 +530,13 @@
err = ceph_osdc_init(&client->osdc, client);
if (err < 0)
goto fail_monc;
- ceph_mdsc_init(&client->mdsc, client);
+ err = ceph_mdsc_init(&client->mdsc, client);
+ if (err < 0)
+ goto fail_osdc;
return client;
+fail_osdc:
+ ceph_osdc_stop(&client->osdc);
fail_monc:
ceph_monc_stop(&client->monc);
fail_trunc_wq: