[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191209162230.14991-1-hslester96@gmail.com>
Date: Tue, 10 Dec 2019 00:22:30 +0800
From: Chuhong Yuan <hslester96@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...ux.intel.com>, x86@...nel.org,
Bruce Beare <bruce.j.beare@...el.com>,
Sheng Yang <sheng@...ux.intel.com>,
Yunhong Jiang <yunhong.jiang@...el.com>,
Alan Cox <alan@...ux.intel.com>,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
Chuhong Yuan <hslester96@...il.com>
Subject: [PATCH] x86/platform/goldfish: add a check for platform_device_register_simple
goldfish_init() misses a check for platform_device_register_simple().
Add a check to fix it.
Fixes: ddd70cf93d78 ("goldfish: platform device for x86")
Signed-off-by: Chuhong Yuan <hslester96@...il.com>
---
arch/x86/platform/goldfish/goldfish.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/x86/platform/goldfish/goldfish.c b/arch/x86/platform/goldfish/goldfish.c
index 6b6f8b4360dd..e9694baf6e72 100644
--- a/arch/x86/platform/goldfish/goldfish.c
+++ b/arch/x86/platform/goldfish/goldfish.c
@@ -44,11 +44,16 @@ __setup("goldfish", goldfish_setup);
static int __init goldfish_init(void)
{
+ struct platform_device *pdev;
+
if (!goldfish_enable)
return -ENODEV;
- platform_device_register_simple("goldfish_pdev_bus", -1,
- goldfish_pdev_bus_resources, 2);
+ pdev = platform_device_register_simple("goldfish_pdev_bus", -1,
+ goldfish_pdev_bus_resources, 2);
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
+
return 0;
}
device_initcall(goldfish_init);
--
2.24.0
Powered by blists - more mailing lists