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

From: Tian, Kevin
Date: Fri Nov 18 2022 - 02:50:32 EST


> From: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> 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?