aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-12-11 11:55:23 -0500
committerSage Weil <sage@newdream.net>2009-12-11 11:59:11 -0500
commitd4a780ce8821a37dd135f15b6150a5bfc5604f29 (patch)
tree677ae00e00f6d483e4cc41fe23b6dfc98bc30207
parent767ea5c33a360ce88da24e296e802dace5821799 (diff)
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>
-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,
320 if (IS_ERR(monmap)) { 320 if (IS_ERR(monmap)) {
321 pr_err("problem decoding monmap, %d\n", 321 pr_err("problem decoding monmap, %d\n",
322 (int)PTR_ERR(monmap)); 322 (int)PTR_ERR(monmap));
323 return; 323 goto out;
324 } 324 }
325 325
326 if (ceph_check_fsid(monc->client, &monmap->fsid) < 0) { 326 if (ceph_check_fsid(monc->client, &monmap->fsid) < 0) {
327 kfree(monmap); 327 kfree(monmap);
328 return; 328 goto out;
329 } 329 }
330 330
331 client->monc.monmap = monmap; 331 client->monc.monmap = monmap;
332 kfree(old); 332 kfree(old);
333 333
334out:
334 mutex_unlock(&monc->mutex); 335 mutex_unlock(&monc->mutex);
335 wake_up(&client->mount_wq); 336 wake_up(&client->mount_wq);
336} 337}