Hi, Julien!

On 10.12.21 19:52, Julien Grall wrote:
> Hi Oleksandr,
>
> On 09/12/2021 07:29, Oleksandr Andrushchenko wrote:
>> +unsigned int domain_vpci_get_num_mmio_handlers(struct domain *d)
>> +{
>> +    if ( !has_vpci(d) )
>> +        return 0;
>> +
>> +    if ( is_hardware_domain(d) )
>> +    {
>> +        int ret = pci_host_iterate_bridges_and_count(d, 
>> vpci_get_num_handlers_cb);
>> +
>> +        return ret < 0 ? 0 : ret;
>
> Sorry I only spotted this now. AFAICT, ret is not meant to return ret < 0 in 
> this case. But if it were then I think it would be wrong to continue as 
> nothing happened because the code will likely fall over/crash when 
> registering the I/O handlers.
>
> I would document this oddity with
>
> if ( ret < 0 )
> {
>    ASSERT_UNREACHABLE();
>    return 0;
> }
>
> I can do the change on commit if the others are happy with it.
Yes, please, do me a favor
>
> Cheers,
>
Thank you,
Oleksandr

Reply via email to