From: majianpeng Date: Tue, 25 Jun 2013 06:48:19 +0000 (+0800) Subject: ceph: Free mdsc if alloc mdsc->mdsmap failed. X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=d5f9a684f9f21324fa58e97be127589db6c06a56;p=linux-edison.git ceph: Free mdsc if alloc mdsc->mdsmap failed. commit fb3101b6f0db9ae3f35dc8e6ec908d0af8cdf12e upstream. Signed-off-by: Jianpeng Ma Reviewed-by: Sage Weil Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 1ce14c18c46..63c789eb1e3 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -3044,8 +3044,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);