spi: spi-fsl-qspi: check return value after calling platform_get_resource_byname()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 5 May 2022 09:39:54 +0000 (17:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:55 +0000 (10:22 +0200)
commit10f537219629769498ecb8515e096be213224c24
treee39577415990efd6ff589c0cf3a2d73ca429c1cd
parent76f5bd1eed01d4f87768ecd11c5a3e1788997be4
spi: spi-fsl-qspi: check return value after calling platform_get_resource_byname()

[ Upstream commit a2b331ac11e1cac56f5b7d367e9f3c5796deaaed ]

It will cause null-ptr-deref if platform_get_resource_byname() returns NULL,
we need check the return value.

Fixes: 858e26a515c2 ("spi: spi-fsl-qspi: Reduce devm_ioremap size to 4 times AHB buffer size")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220505093954.1285615-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-fsl-qspi.c