All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/2] platform/x86: thinklmi: improved DMI handling
@ 2025-06-10 19:28 Mark Pearson
  2025-06-10 19:28 ` [PATCH v4 2/2] platform/x86: Move Lenovo files into lenovo subdir Mark Pearson
  2025-06-10 20:22 ` [PATCH v4 1/2] platform/x86: thinklmi: improved DMI handling Andy Shevchenko
  0 siblings, 2 replies; 8+ messages in thread
From: Mark Pearson @ 2025-06-10 19:28 UTC (permalink / raw)
  To: mpearson-lenovo
  Cc: ilpo.jarvinen, hdegoede, ikepanhc, hmh, W_Armin,
	andriy.shevchenko, platform-driver-x86, ibm-acpi-devel,
	linux-kernel, kernel test robot

Fix issues reported by kernel test robot.
 - Require DMI for think-lmi.
 - Check return from getting serial string

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202506062319.F0IpDxF6-lkp@intel.com/
Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
---
Changes in v4:
 - Return -ENODEV instead of -EINVAL
 - Make patch first in series
 - Clean up commit message (empty line)
Changes in v3:
 - New patch added to series.

 drivers/platform/x86/Kconfig     | 1 +
 drivers/platform/x86/think-lmi.c | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index e5cbd58a99f3..9f39547d98f6 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -659,6 +659,7 @@ config THINKPAD_ACPI_HOTKEY_POLL
 config THINKPAD_LMI
 	tristate "Lenovo WMI-based systems management driver"
 	depends on ACPI_WMI
+	depends on DMI
 	select FW_ATTR_CLASS
 	help
 	  This driver allows changing BIOS settings on Lenovo machines whose
diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
index 00b1e7c79a3d..02ede1ec99e9 100644
--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -772,6 +772,7 @@ static ssize_t certificate_store(struct kobject *kobj,
 	struct tlmi_pwd_setting *setting = to_tlmi_pwd_setting(kobj);
 	enum cert_install_mode install_mode = TLMI_CERT_INSTALL;
 	char *auth_str, *new_cert;
+	const char *serial;
 	char *signature;
 	char *guid;
 	int ret;
@@ -789,9 +790,10 @@ static ssize_t certificate_store(struct kobject *kobj,
 			return -EACCES;
 
 		/* Format: 'serial#, signature' */
-		auth_str = cert_command(setting,
-					dmi_get_system_info(DMI_PRODUCT_SERIAL),
-					setting->signature);
+		serial = dmi_get_system_info(DMI_PRODUCT_SERIAL);
+		if (!serial)
+			return -ENODEV;
+		auth_str = cert_command(setting, serial, setting->signature);
 		if (!auth_str)
 			return -ENOMEM;
 
-- 
2.43.0


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

end of thread, other threads:[~2025-06-11 15:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 19:28 [PATCH v4 1/2] platform/x86: thinklmi: improved DMI handling Mark Pearson
2025-06-10 19:28 ` [PATCH v4 2/2] platform/x86: Move Lenovo files into lenovo subdir Mark Pearson
2025-06-10 20:27   ` Andy Shevchenko
2025-06-10 23:11     ` Mark Pearson
2025-06-11 15:01       ` Ilpo Järvinen
2025-06-11 15:07         ` Andy Shevchenko
2025-06-11 15:47           ` Mark Pearson
2025-06-10 20:22 ` [PATCH v4 1/2] platform/x86: thinklmi: improved DMI handling Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.