summaryrefslogtreecommitdiffstats
path: root/fs/ceph/mon_client.c
diff options
context:
space:
mode:
authorSage Weil2009-12-11 17:55:23 +0100
committerSage Weil2009-12-11 17:59:11 +0100
commitd4a780ce8821a37dd135f15b6150a5bfc5604f29 (patch)
tree677ae00e00f6d483e4cc41fe23b6dfc98bc30207 /fs/ceph/mon_client.c
parentceph: do not feed bad device ids to crush (diff)
downloadkernel-qcow2-linux-d4a780ce8821a37dd135f15b6150a5bfc5604f29.tar.gz
kernel-qcow2-linux-d4a780ce8821a37dd135f15b6150a5bfc5604f29.tar.xz
kernel-qcow2-linux-d4a780ce8821a37dd135f15b6150a5bfc5604f29.zip
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>
Diffstat (limited to 'fs/ceph/mon_client.c')
-rw-r--r--fs/ceph/mon_client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/mon_client.c b/fs/ceph/mon_client.c
index 1dd0dc258c50..a76da5e6dbdd 100644
--- a/fs/ceph/mon_client.c
+++ b/fs/ceph/mon_client.c
@@ -320,17 +320,18 @@ static void ceph_monc_handle_map(struct ceph_mon_client *monc,
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);
}