lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 20 Mar 2010 20:59:39 -0700 (PDT)
From:	Sage Weil <sage@...dream.net>
To:	Dan Carpenter <error27@...il.com>
cc:	Yehuda Sadeh <yehuda@...newdream.net>,
	ceph-devel@...ts.sourceforge.net, kernel-janitors@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [ceph-devel] [patch] ceph: handle kmalloc() failure

On Sat, 20 Mar 2010, Dan Carpenter wrote:

> Return ERR_PTR(-ENOMEM) if kmalloc() fails.  We handle allocation 
> failures the same way later in the function.
> 
> Signed-off-by: Dan Carpenter <error27@...il.com>
> 
> diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
> index a260010..655b005 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,
>  	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;

Applied, thanks!
sage

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists