Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4736b009 authored by Dan Carpenter's avatar Dan Carpenter Committed by Sage Weil
Browse files

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 9c423956
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;