[PATCH] iommu/riscv: Fix unsigned comparison with negative error code
Joerg Roedel
joro at 8bytes.org
Sat Jan 10 02:15:23 PST 2026
On Mon, Dec 22, 2025 at 06:15:49PM +0300, Alper Ak wrote:
> - iommu->irqs_count = platform_irq_count(pdev);
> - if (iommu->irqs_count <= 0)
> + ret = platform_irq_count(pdev);
> + if (ret < 0)
> + return ret;
> +
> + iommu->irqs_count = ret;
> +
> + if (!iommu->irqs_count)
> return dev_err_probe(dev, -ENODEV,
> "no IRQ resources provided\n");
Separate the ret < 0 and ret == 0 checks is wrong, just check them in one if
statement and return the dev_err_probe() value as before.
-Joerg
More information about the linux-riscv
mailing list