RE: [patch 06/20] genirq/msi: Check for invalid MSI parent domain usage

Tian, Kevin
2022-11-18T07:50:32Z

> From: Thomas Gleixner <tglx@linutronix.de>
> Sent: Friday, November 11, 2022 9:57 PM
>
> @@ -937,13 +937,21 @@ int msi_domain_alloc_irqs_descs_locked(s
>
> lockdep_assert_held(&dev->msi.data->mutex);
>
> + if (WARN_ON_ONCE(irq_domain_is_msi_parent(domain))) {
> + ret = -EINVAL;
> + goto free;
> + }
> +
> + /* Frees allocated descriptors in case of failure. */
> ret = msi_domain_add_simple_msi_descs(info, dev, nvec);
> if (ret)
> return ret;

it's unusual to see a direct return when error unwind is already required
at an early failure point. is it something which can be improved here?