[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH] scsi: Implement alloc_req_iov callback
From: |
Hannes Reinecke |
Subject: |
Re: [Qemu-devel] Re: [PATCH] scsi: Implement alloc_req_iov callback |
Date: |
Tue, 23 Nov 2010 09:12:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101026 SUSE/3.0.10 Thunderbird/3.0.10 |
On 11/22/2010 10:48 PM, Stefan Hajnoczi wrote:
> On Mon, Nov 22, 2010 at 10:15 AM, Hannes Reinecke <address@hidden> wrote:
> Looks good. If you send out another version of the patchset you might
> like to fix this nitpick:
>
>> + if (!r->io_header.iovec_count) {
>> + if (r->buflen != r->req.cmd.xfer) {
>> + if (r->buf != NULL)
>> + qemu_free(r->buf);
>
> qemu_free(NULL) is a nop so it's safe to drop the if (r->buf != NULL)
> check and just use qemu_free(r->buf) unconditionally. That's nice
> since it also fixes the if statement without curly braces.
>
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
--
Dr. Hannes Reinecke zSeries & Storage
address@hidden +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)