ceph: fix leak of monc mutex
Fix leak of monc mutex on ENOMEM or bad fsid when receiving new mon map.
Audited all other users.
Signed-off-by: Sage Weil <sage@newdream.net>
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index 1dd0dc2..a76da5e 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -320,17 +320,18 @@
if (IS_ERR(monmap)) {
pr_err("problem decoding monmap, %d\n",
(int)PTR_ERR(monmap));
- return;
+ goto out;
}
if (ceph_check_fsid(monc->client, &monmap->fsid) < 0) {
kfree(monmap);
- return;
+ goto out;
}
client->monc.monmap = monmap;
kfree(old);
+out:
mutex_unlock(&monc->mutex);
wake_up(&client->mount_wq);
}