[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElem
From: |
Markus Armbruster |
Subject: |
Re: [PATCH] contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement |
Date: |
Fri, 01 Jul 2022 07:40:59 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Raphael Norwitz <raphael.norwitz@nutanix.com> writes:
> On Thu, Jun 30, 2022 at 10:52:19AM +0200, Markus Armbruster wrote:
>> We allocate VuVirtqElement with g_malloc() in
>> virtqueue_alloc_element(), but free it with free() in
>> vhost-user-blk.c. Harmless, but use g_free() anyway.
>>
>> One of the calls is guarded by a "not null" condition. Useless,
>> because it cannot be null (it's dereferenced right before), and even
>
> NIT: if it
Yes.
>> it it could be, free() and g_free() do the right thing. Drop the
>> conditional.
>>
>
> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
>
>> Fixes: Coverity CID 1490290
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>> Not even compile-tested, because I can't figure out how this thing is
>> supposed to be built. Its initial commit message says "make
>> vhost-user-blk", but that doesn't work anymore.
>>
>
> make contrib/vhost-user-blk/vhost-user-blk works for me.
Could we use a contrib/README with an explanation what "contrib" means,
and how to build and use the stuff there?
Thanks!