From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKXpg-0002Bd-9b for qemu-devel@nongnu.org; Fri, 13 Sep 2013 14:11:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKXpb-0003vs-T4 for qemu-devel@nongnu.org; Fri, 13 Sep 2013 14:11:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKXpb-0003vm-K4 for qemu-devel@nongnu.org; Fri, 13 Sep 2013 14:10:59 -0400 Message-ID: <5233552C.90904@redhat.com> Date: Fri, 13 Sep 2013 12:10:52 -0600 From: Eric Blake MIME-Version: 1.0 References: <1379067909-22984-1-git-send-email-pl@kamp.de> <1379067909-22984-5-git-send-email-pl@kamp.de> In-Reply-To: <1379067909-22984-5-git-send-email-pl@kamp.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2hdTnMxOHWFg6GEtQ65E1OGtBDlb6cd2f" Subject: Re: [Qemu-devel] [PATCH 04/12] iscsi: add .bdrv_co_write_zeroes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, stefanha@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2hdTnMxOHWFg6GEtQ65E1OGtBDlb6cd2f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/13/2013 04:25 AM, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > block/iscsi.c | 78 +++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 file changed, 78 insertions(+) >=20 > + if (iscsilun->zeroblock =3D=3D NULL) { > + iscsilun->zeroblock =3D g_malloc(iscsilun->block_size); > + if (iscsilun->zeroblock =3D=3D NULL) { > + return -ENOMEM; g_malloc cannot return NULL (it aborts the program on OOM instead), so this is dead code. > + } > + memset(iscsilun->zeroblock, 0x00, iscsilun->block_size); Furthermore, if you had used g_malloc0(), you wouldn't need this memset. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --2hdTnMxOHWFg6GEtQ65E1OGtBDlb6cd2f Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSM1UsAAoJEKeha0olJ0NqlPMIAJZDXiA9HSZHv/rCc2b1qQrb Gxc6Kx8iaexmQeBAvmGpMV10sGaPtzyF4S0W09iOj8pC+k/fSU8ZGeSKaTsmq1HS nZ48mAwpaQDk54y6qtWjWWFe0iw3kUvkCU0G5Xut6+4tXUPdINuplvDzNVCJneuC VMLP95/M4zueWWTWkxq7TSQDZ7vfe/XwVf4EZakgmupA0MZMbwY8z0ABpbFPEdng 5pBoTMuo+3HIE01wbx32ZkJjrUtFOSxojSaSpBThLMkMoPXs0rMlDfOknbgEvHUJ F2zf5pIpvbQhPzi1b2nfTXQKd65NOEwPXlx8FlQWUN3UufSLGP/+6FZMApXaM+A= =9A4V -----END PGP SIGNATURE----- --2hdTnMxOHWFg6GEtQ65E1OGtBDlb6cd2f--