Hi Jan,

> On 11 Aug 2022, at 11:51 am, Jan Beulich <[email protected]> wrote:
> 
> The last "wildcard" use of either function went away with f591755823a7
> ("IOMMU/PCI: don't let domain cleanup continue when device de-assignment
> failed"). Don't allow them to be called this way anymore. Besides
> simplifying the code this also fixes two bugs:
> 
> 1) When seg != -1, the outer loops should have been terminated after the
>   first iteration, or else a device with the same BDF but on another
>   segment could be found / returned.
> 
> Reported-by: Rahul Singh <[email protected]>
> 
> 2) When seg == -1 calling get_pseg() is bogus. The function (taking a
>   u16) would look for segment 0xffff, which might exist. If it exists,
>   we might then find / return a wrong device.
> 
> In pci_get_pdev_by_domain() also switch from using the per-segment list
> to using the per-domain one, with the exception of the hardware domain
> (see the code comment there).
> 
> While there also constify "pseg" and drop "pdev"'s already previously
> unnecessary initializer.
> 
> Signed-off-by: Jan Beulich <[email protected]>

I tested the patch series on ARM  and it works as expected.

Reviewed-by: Rahul Singh <[email protected]>
Tested-by: Rahul Singh <[email protected]>

Regards,
Rahul
 

Reply via email to