Commit fb3101b6 authored by majianpeng's avatar majianpeng Committed by Sage Weil

ceph: Free mdsc if alloc mdsc->mdsmap failed.

Signed-off-by: default avatarJianpeng Ma <majianpeng@gmail.com>
Reviewed-by: default avatarSage Weil <sage@inktank.com>
parent 0405a149
...@@ -3042,8 +3042,10 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc) ...@@ -3042,8 +3042,10 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc)
fsc->mdsc = mdsc; fsc->mdsc = mdsc;
mutex_init(&mdsc->mutex); mutex_init(&mdsc->mutex);
mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS); mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS);
if (mdsc->mdsmap == NULL) if (mdsc->mdsmap == NULL) {
kfree(mdsc);
return -ENOMEM; return -ENOMEM;
}
init_completion(&mdsc->safe_umount_waiters); init_completion(&mdsc->safe_umount_waiters);
init_waitqueue_head(&mdsc->session_close_wq); init_waitqueue_head(&mdsc->session_close_wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment