qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user


From: Richard Henderson
Subject: Re: [PATCH v5 19/31] linux-user: Handle tags in lock_user/unlock_user
Date: Mon, 8 Feb 2021 09:32:30 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 2/8/21 5:57 AM, Peter Maydell wrote:
>>  void unlock_user(void *host_ptr, abi_ulong guest_addr, size_t len);
....
>> -    if (len > 0) {
>> -        memcpy(g2h_untagged(guest_addr), host_ptr, len);
>> +    if (len != 0) {
>> +        memcpy(host_ptr_conv, host_ptr, len);
>>      }
> 
> Why the change from checking >0 to checking !=0 ? I'd rather not
> have to go through and audit all the callsites to confirm none
> of them pass a "length-or-negative-errno" value here...

The comparison change should have happened with the type change to unsigned in
the previous patch.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]