From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60182 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKnxH-0000h6-DP for qemu-devel@nongnu.org; Tue, 23 Nov 2010 03:10:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKnwu-0003Ou-9t for qemu-devel@nongnu.org; Tue, 23 Nov 2010 03:10:23 -0500 Received: from cantor.suse.de ([195.135.220.2]:42848 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKnwu-0003Ns-4k for qemu-devel@nongnu.org; Tue, 23 Nov 2010 03:10:00 -0500 Message-ID: <4CEB7778.4010900@suse.de> Date: Tue, 23 Nov 2010 09:12:40 +0100 From: Hannes Reinecke MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] scsi: Implement alloc_req_iov callback References: <20101122101536.2B09BF90AF@ochil.suse.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, nab@linux-iscsi.org, kraxel@redhat.com On 11/22/2010 10:48 PM, Stefan Hajnoczi wrote: > On Mon, Nov 22, 2010 at 10:15 AM, Hannes Reinecke wrote: > Looks good. If you send out another version of the patchset you might > like to fix this nitpick: >=20 >> + if (!r->io_header.iovec_count) { >> + if (r->buflen !=3D r->req.cmd.xfer) { >> + if (r->buf !=3D NULL) >> + qemu_free(r->buf); >=20 > qemu_free(NULL) is a nop so it's safe to drop the if (r->buf !=3D NULL) > check and just use qemu_free(r->buf) unconditionally. That's nice > since it also fixes the if statement without curly braces. >=20 Really? qemu-malloc.c has: void qemu_free(void *ptr) { trace_qemu_free(ptr); free(ptr); } and 'free' doesn't normally do an error checking on the argument. Am I missing something? Cheers, Hannes --=20 Dr. Hannes Reinecke zSeries & Storage hare@suse.de +49 911 74053 688 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg GF: Markus Rex, HRB 16746 (AG N=FCrnberg)