spi: meson-spicc: add IRQ check in meson_spicc_probe
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 26 Jan 2022 11:04:47 +0000 (11:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Feb 2022 17:34:08 +0000 (18:34 +0100)
commit66606d329d61c178f10605bbd3f8994d244c9683
treea357d5dfe247e94d486e92242776a447c151d1f9
parent7352f2c264824acd589d7cbbf9348e6870d4ddea
spi: meson-spicc: add IRQ check in meson_spicc_probe

commit e937440f7fc444a3e3f1fb75ea65292d6f433a44 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-meson-spicc.c