summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2023-06-09 09:48:18 +0800
committerLee Jones <lee@kernel.org>2023-06-15 09:19:39 +0100
commitd918e0d5824495a75d00b879118b098fcab36fdb (patch)
tree8ae36d223e6f58ae4023008bd8f7924b1a788f1f
parent6e9df38f359a26431609320bd38ea9a81bb4d63d (diff)
mfd: intel-lpss: Add missing check for platform_get_resource
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
-rw-r--r--drivers/mfd/intel-lpss-acpi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c
index a143c8dca2d9..212818aef93e 100644
--- a/drivers/mfd/intel-lpss-acpi.c
+++ b/drivers/mfd/intel-lpss-acpi.c
@@ -183,6 +183,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);