X86 platform drivers
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: "Mark Pearson" <mpearson-lenovo@squebb.ca>,
	"Derek J. Clark" <derekjohn.clark@gmail.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
	stable@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] platform/x86: think-lmi: Keep pending save state on failure
Date: Mon, 10 Aug 2026 14:08:32 +0200	[thread overview]
Message-ID: <20260810120830.149804-3-thorsten.blum@linux.dev> (raw)

In save_settings_store(), the opcode and legacy password paths do not
check if saving BIOS settings failed, but instead unconditionally clear
save_required and set reboot_required, losing the pending save state.

Check the save result in those paths too.

Fixes: 318d97849fc2 ("platform/x86: think-lmi: Add bulk save feature")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 drivers/platform/x86/lenovo/think-lmi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/platform/x86/lenovo/think-lmi.c b/drivers/platform/x86/lenovo/think-lmi.c
index e215e86e3db7..cc0a85d1b832 100644
--- a/drivers/platform/x86/lenovo/think-lmi.c
+++ b/drivers/platform/x86/lenovo/think-lmi.c
@@ -1347,6 +1347,8 @@ static ssize_t save_settings_store(struct kobject *kobj, struct kobj_attribute *
 					goto out;
 			}
 			ret = tlmi_save_bios_settings("");
+			if (ret)
+				goto out;
 		} else { /* old non-opcode based authentication method (deprecated) */
 			if (tlmi_priv.pwd_admin->pwd_enabled && tlmi_priv.pwd_admin->password[0]) {
 				auth_str = kasprintf(GFP_KERNEL, "%s,%s,%s;",
@@ -1363,6 +1365,8 @@ static ssize_t save_settings_store(struct kobject *kobj, struct kobj_attribute *
 				ret = tlmi_save_bios_settings(auth_str);
 			else
 				ret = tlmi_save_bios_settings("");
+			if (ret)
+				goto out;
 		}
 		tlmi_priv.save_required = false;
 		tlmi_priv.reboot_required = true;

             reply	other threads:[~2026-08-10 12:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-10 12:08 Thorsten Blum [this message]
2026-08-11 19:29 ` [PATCH] platform/x86: think-lmi: Keep pending save state on failure Mark Pearson
2026-08-11 20:39   ` Thorsten Blum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260810120830.149804-3-thorsten.blum@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=derekjohn.clark@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox