dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Dan Carpenter 2010-03-20 15:30:16 +03:00 committed by Sage Weil
parent 9c423956b8
commit 4736b009b8
1 changed files with 2 additions and 0 deletions

View File

@ -328,6 +328,8 @@ static struct ceph_mds_session *register_session(struct ceph_mds_client *mdsc,
struct ceph_mds_session *s;
s = kzalloc(sizeof(*s), GFP_NOFS);
if (!s)
return ERR_PTR(-ENOMEM);
s->s_mdsc = mdsc;
s->s_mds = mds;
s->s_state = CEPH_MDS_SESSION_NEW;