spi: tegra: Fix missing IRQ check in tegra_slink_probe()
authorZhang Shurong <zhang_shurong@foxmail.com>
Sat, 26 Aug 2023 10:02:54 +0000 (18:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:51:55 +0000 (11:51 +0100)
commit5c25f89c00b97844d0427f0f96818a15714bd609
treef342f889cb6085d079bb9c29942bf45bb2d82b7f
parent51d4d3cd18362a95670ba54e3dbebc031a70e803
spi: tegra: Fix missing IRQ check in tegra_slink_probe()

[ Upstream commit eb9913b511f10968a02cfa5329a896855dd152a3 ]

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

Fix this by stop calling request_irq() with invalid IRQ #s.

Fixes: dc4dc3605639 ("spi: tegra: add spi driver for SLINK controller")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Link: https://lore.kernel.org/r/tencent_73FCC06A3D1C14EE5175253C6FB46A07B709@qq.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-tegra20-slink.c