Philippe Mathieu-Daudé <[email protected]> writes:

> On 13/10/25 13:21, Markus Armbruster wrote:
>> Reported-by: Bernhard Beschow <[email protected]>
>> Fixes: b296b29d3414 (ui/pixman: Consistent error handling in 
>> qemu_pixman_shareable_free())
>> Signed-off-by: Markus Armbruster <[email protected]>
>> ---
>>   ui/qemu-pixman.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>> 
>> diff --git a/ui/qemu-pixman.c b/ui/qemu-pixman.c
>> index e46c6232cf..aea09755b9 100644
>> --- a/ui/qemu-pixman.c
>> +++ b/ui/qemu-pixman.c
>> @@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,
>>       Error *err = NULL;
>>   
>>       qemu_win32_map_free(ptr, handle, &err);
>
> Slightly better if qemu_win32_map_free(), as per commit e3fe3988d78
> ("error: Document Error API usage rules") recommended style:
>
> + *  We recommend
> + *   • bool-valued functions return true on success / false on failure,
> + *   • pointer-valued functions return non-null / null pointer, and
> + *   • integer-valued functions return non-negative / negative.

I went fo a minimal fix.

I now see that this is the only use of qemu_win32_map_free().  Changing
it to return bool would've been okay.

> Anyhow,
> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>

Thanks!

>> -    error_report_err(err);
>> +    if (err) {
>> +        error_report_err(err);
>> +    }
>>   #else
>>       qemu_memfd_free(ptr, size, handle);
>>   #endif


Reply via email to