Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: meson-spicc: add IRQ check in meson_spicc_probe

This check misses checking for platform_get_irq()'s call and may passes
the negative error codes to devm_request_irq(), which takes unsigned IRQ #,
causing it to fail with -EINVAL, overriding an original error code.
Stop calling devm_request_irq() with invalid IRQ #s.

Fixes: 454fa271bc4e ("spi: Add Meson SPICC driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220126110447.24549-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Miaoqian Lin and committed by
Mark Brown
e937440f 23e3404d

+5
+5
drivers/spi/spi-meson-spicc.c
··· 693 693 writel_relaxed(0, spicc->base + SPICC_INTREG); 694 694 695 695 irq = platform_get_irq(pdev, 0); 696 + if (irq < 0) { 697 + ret = irq; 698 + goto out_master; 699 + } 700 + 696 701 ret = devm_request_irq(&pdev->dev, irq, meson_spicc_irq, 697 702 0, NULL, spicc); 698 703 if (ret) {