public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.9 5/8] ACPI: LPSS: Fix missing check in register_device_clock()
       [not found] <20220808014005.317064-1-sashal@kernel.org>
@ 2022-08-08  1:40 ` Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2022-08-08  1:40 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: huhai, Rafael J . Wysocki, Sasha Levin, rafael, linux-acpi

From: huhai <huhai@kylinos.cn>

[ Upstream commit b4f1f61ed5928b1128e60e38d0dffa16966f06dc ]

register_device_clock() misses a check for platform_device_register_simple().
Add a check to fix it.

Signed-off-by: huhai <huhai@kylinos.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/acpi_lpss.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index a9158858f54c..6ca4b3dc11ca 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -330,6 +330,9 @@ static int register_device_clock(struct acpi_device *adev,
 	if (!lpss_clk_dev)
 		lpt_register_clock_device();
 
+	if (IS_ERR(lpss_clk_dev))
+		return PTR_ERR(lpss_clk_dev);
+
 	clk_data = platform_get_drvdata(lpss_clk_dev);
 	if (!clk_data)
 		return -ENODEV;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-08  1:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20220808014005.317064-1-sashal@kernel.org>
2022-08-08  1:40 ` [PATCH AUTOSEL 4.9 5/8] ACPI: LPSS: Fix missing check in register_device_clock() Sasha Levin

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