From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH 1/8] utilfdt_read_err: use xmalloc funcs Date: Mon, 8 Apr 2013 19:42:24 +1000 Message-ID: <20130408094224.GJ17787@truffula.fritz.box> References: <1365404812-15153-1-git-send-email-vapier@gentoo.org> <1365404812-15153-2-git-send-email-vapier@gentoo.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7564013634353446063==" Return-path: In-Reply-To: <1365404812-15153-2-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Mike Frysinger Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org List-Id: devicetree@vger.kernel.org --===============7564013634353446063== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fKov5AqTsvseSZ0Z" Content-Disposition: inline --fKov5AqTsvseSZ0Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 08, 2013 at 03:06:45AM -0400, Mike Frysinger wrote: > We've got these handy helpers, so let's use them. >=20 > Signed-off-by: Mike Frysinger Acked-by: David Gibs on > --- > util.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/util.c b/util.c > index b081fa8..12f0614 100644 > --- a/util.c > +++ b/util.c > @@ -212,12 +212,12 @@ int utilfdt_read_err(const char *filename, char **b= uffp) > } > =20 > /* Loop until we have read everything */ > - buf =3D malloc(bufsize); > + buf =3D xmalloc(bufsize); > do { > /* Expand the buffer to hold the next chunk */ > if (offset =3D=3D bufsize) { > bufsize *=3D 2; > - buf =3D realloc(buf, bufsize); > + buf =3D xrealloc(buf, bufsize); > if (!buf) { > ret =3D ENOMEM; > break; --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --fKov5AqTsvseSZ0Z Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlFikQAACgkQaILKxv3ab8bpTwCfXQGftSRtC0uoM1ikFDEs6qhe BVsAoIf4vvKMA0aDBt3Ztfk30Viq026g =EEgM -----END PGP SIGNATURE----- --fKov5AqTsvseSZ0Z-- --===============7564013634353446063== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ devicetree-discuss mailing list devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org https://lists.ozlabs.org/listinfo/devicetree-discuss --===============7564013634353446063==--