ceph: Free mdsc if alloc mdsc->mdsmap failed.
PATCH 1/1 ceph: Free mdsc if alloc mdsc->mdsmap failed.
Signed-off-by Jianpeng Ma <[email protected]>
--- fs/ceph/mds_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ceph/mds_client.c +3 -1
@@ -3040,8 +3040,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);
Signature · 1 line
1.8.1.2
Sage Weil
AppliedApplied, thanks!
sage
Quoted 24 lines · majianpeng
Signed-off-by Jianpeng Ma <[email protected]>--- fs/ceph/mds_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)fs/ceph/mds_client.c +3
-1@@ -3040,8 +3040,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);Signature · 1 line
1.8.1.2