From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SenNb-0001hh-02 for qemu-devel@nongnu.org; Wed, 13 Jun 2012 09:13:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SenNW-0003z7-6c for qemu-devel@nongnu.org; Wed, 13 Jun 2012 09:12:58 -0400 Received: from cantor2.suse.de ([195.135.220.15]:49045 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SenNW-0003ys-0R for qemu-devel@nongnu.org; Wed, 13 Jun 2012 09:12:54 -0400 Message-ID: <4FD891D0.3050508@suse.de> Date: Wed, 13 Jun 2012 15:12:48 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1338984323-21914-1-git-send-email-jfrei@de.ibm.com> <1338984323-21914-7-git-send-email-jfrei@de.ibm.com> <4FD72A1F.2000903@suse.de> <1339570821.3591.7.camel@BR8HFPP0.boeblingen.de.ibm.com> In-Reply-To: <1339570821.3591.7.camel@BR8HFPP0.boeblingen.de.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 6/8] s390: sclp event facility and signal quiesce support via system_powerdown List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Heinz Graalfs Cc: Jens Freimann , Alexander Graf , qemu-devel , Christian Borntraeger , Jens Freimann , Cornelia Huck Am 13.06.2012 09:00, schrieb Heinz Graalfs: > Alex, thanks for the comments, >=20 > On Tue, 2012-06-12 at 13:38 +0200, Alexander Graf wrote: >> On 06/06/2012 02:05 PM, Jens Freimann wrote: >>> +static SCLPDevice *sclpef_common_init(const char *name, size_t struc= t_size) >>> +{ >>> + SCLPDevice *sdev; >>> + >>> + sdev =3D malloc(struct_size); >> >> g_malloc please. I suppose even g_malloc0? >> > OK, I will look into this Careful: The equivalent of malloc() and a NULL check is g_try_malloc(). g_malloc() aborts on failure to allocate. The line to draw is whether this only happens at startup or whether this is called at runtime *and* you are willing to consequently handle the possible NULL return in all callers. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg