Skip to content

Commit

Permalink
ceph: fix leak of monc mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sage Weil committed Dec 11, 2009
1 parent 767ea5c commit d4a780c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/ceph/mon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d4a780c

Please sign in to comment.