summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authormajianpeng <majianpeng@gmail.com>2013-06-25 06:48:19 (GMT)
committerSage Weil <sage@inktank.com>2013-07-03 22:32:53 (GMT)
commitfb3101b6f0db9ae3f35dc8e6ec908d0af8cdf12e (patch)
tree14253af04f0012782e4809e64eefbde11115ac23 /fs
parent0405a1499df42a2b9fd4906096c6bb950e15e850 (diff)
downloadlinux-fsl-qoriq-fb3101b6f0db9ae3f35dc8e6ec908d0af8cdf12e.tar.xz
ceph: Free mdsc if alloc mdsc->mdsmap failed.
Signed-off-by: Jianpeng Ma <majianpeng@gmail.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/mds_client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index 6272c78..3eb1b44 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -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);