Skip to content

Commit

Permalink
ceph: Free mdsc if alloc mdsc->mdsmap failed.
Browse files Browse the repository at this point in the history
Signed-off-by: Jianpeng Ma <[email protected]>
Reviewed-by: Sage Weil <[email protected]>
  • Loading branch information
majianpeng authored and Sage Weil committed Jul 3, 2013
1 parent 0405a14 commit fb3101b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fb3101b

Please sign in to comment.