diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2023-06-09 09:48:18 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-11 11:45:12 +0200 |
commit | ba8711b5391a99b2adb85137d892a5dc521db866 (patch) | |
tree | dd7f74aa1ca460b20f3b440f7846f31e8c78040b | |
parent | 7f476bc0b2a31a1f186de917c289a577dfb03d43 (diff) | |
download | linux-stable-ba8711b5391a99b2adb85137d892a5dc521db866.tar.gz linux-stable-ba8711b5391a99b2adb85137d892a5dc521db866.tar.bz2 linux-stable-ba8711b5391a99b2adb85137d892a5dc521db866.zip |
mfd: intel-lpss: Add missing check for platform_get_resource
[ Upstream commit d918e0d5824495a75d00b879118b098fcab36fdb ]
Add the missing check for platform_get_resource and return error
if it fails.
Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230609014818.28475-1-jiasheng@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/mfd/intel-lpss-acpi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index fc44fb7c595b..281ef5f52eb5 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -92,6 +92,9 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev) return -ENOMEM; info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!info->mem) + return -ENODEV; + info->irq = platform_get_irq(pdev, 0); ret = intel_lpss_probe(&pdev->dev, info); |