1
0
Fork 0

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

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Reviewed-by: Sage Weil <sage@inktank.com>
hifive-unleashed-5.1
majianpeng 2013-06-25 14:48:19 +08:00 committed by Sage Weil
parent 0405a1499d
commit fb3101b6f0
1 changed files with 3 additions and 1 deletions

View File

@ -3042,8 +3042,10 @@ int ceph_mdsc_init(struct ceph_fs_client *fsc)
fsc->mdsc = mdsc;
mutex_init(&mdsc->mutex);
mdsc->mdsmap = kzalloc(sizeof(*mdsc->mdsmap), GFP_NOFS);
if (mdsc->mdsmap == NULL)
if (mdsc->mdsmap == NULL) {
kfree(mdsc);
return -ENOMEM;
}
init_completion(&mdsc->safe_umount_waiters);
init_waitqueue_head(&mdsc->session_close_wq);