Re: [patch V4 02/21] irqchip: Provide irq-msi-lib

From: Thomas Gleixner
Date: Wed Jul 03 2024 - 09:58:25 EST


On Mon, Jul 01 2024 at 12:18, Lorenzo Pieralisi wrote:
> On Sun, Jun 23, 2024 at 05:18:34PM +0200, Thomas Gleixner wrote:
>> +bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain,
>> + struct irq_domain *real_parent,
>> + struct msi_domain_info *info)
>> +{
>> + const struct msi_parent_ops *pops = real_parent->msi_parent_ops;
>> +
>> + /*
>> + * MSI parent domain specific settings. For now there is only the
>> + * root parent domain, e.g. NEXUS, acting as a MSI parent, but it is
>> + * possible to stack MSI parents. See x86 vector -> irq remapping
>> + */
>> + if (domain->bus_token == pops->bus_select_token) {
>> + if (WARN_ON_ONCE(domain != real_parent))
>> + return false;
>> + } else {
>> + WARN_ON_ONCE(1);
>> + return false;
>> + }
>> +
>> + /* Parent ops available? */
>> + if (WARN_ON_ONCE(!pops))
>
> We have already dereferenced pops above, we should move this warning
> before we dereference it (ie checked devmsi-arm-v4-2 too - branch same
> comment applies there too).

Oops. Yes.