public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] mfd: intel-lpss: Add missing check for platform_get_resource
@ 2023-06-09  1:48 Jiasheng Jiang
  2023-06-09  6:38 ` Lee Jones
  2023-11-24 17:47 ` Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Jiasheng Jiang @ 2023-06-09  1:48 UTC (permalink / raw)
  To: lee; +Cc: linux-kernel, Jiasheng Jiang

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>
---
Changelog:

v1 -> v2:

1. Replace "-ENOMEM" with "-ENODEV".
---
 drivers/mfd/intel-lpss-acpi.c | 3 +++
 1 file changed, 3 insertions(+)

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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-30 11:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-09  1:48 [PATCH v2] mfd: intel-lpss: Add missing check for platform_get_resource Jiasheng Jiang
2023-06-09  6:38 ` Lee Jones
2023-11-24 17:47 ` Andy Shevchenko
2023-11-27  8:53   ` Lee Jones
2023-11-27 12:50     ` Andy Shevchenko
2023-11-30 11:35       ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox