aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-20 08:30:16 -0400
committerSage Weil <sage@newdream.net>2010-03-23 10:47:04 -0400
commit4736b009b880b7c19bea36327a71032a6dbee402 (patch)
tree3702b662c5d3f1048680e7766308df464c9af8f2 /fs/ceph/mds_client.c
parent9c423956b8a495f0c048143abc5da955a70eac97 (diff)
ceph: handle kmalloc() failure
Return ERR_PTR(-ENOMEM) if kmalloc() fails. We handle allocation failures the same way later in the function. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index b6b5348055f..ad0fbc3128d 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -328,6 +328,8 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc,
328 struct ceph_mds_session *s; 328 struct ceph_mds_session *s;
329 329
330 s = kzalloc(sizeof(*s), GFP_NOFS); 330 s = kzalloc(sizeof(*s), GFP_NOFS);
331 if (!s)
332 return ERR_PTR(-ENOMEM);
331 s->s_mdsc = mdsc; 333 s->s_mdsc = mdsc;
332 s->s_mds = mds; 334 s->s_mds = mds;
333 s->s_state = CEPH_MDS_SESSION_NEW; 335 s->s_state = CEPH_MDS_SESSION_NEW;