From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA61A412C16 for ; Tue, 11 Aug 2026 20:39:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786480787; cv=none; b=BHDvYwJmhx7kVptc6gd02TizrEAQYk3e8hlNLTuK49mfn4JxA51mO+Oy4Dr1AjBT0ENuEoNeKj3itFghFKacGlZEbFrrXML7SKCF+1shFYx9PpyBjqmRKsT21jtAPa+AXV0K2A1Klc3eYePVTCple6Ailz2fgb9R/BIZDQJBG0I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786480787; c=relaxed/simple; bh=D2o0TEwznbSnrdQ/m8p3eHjT6PByyLCpzarc5zQ2xYI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=McQQWn42E3GByjWVMHn+JuxUatolLC5eYfMO6MCTCwn/wQ/UIH/80cdcvBl8qWj3qWMxXcIyhd9lpVZZDzi/o6bv9oDDkS+SgOhIRM4ijuPOyfZ8lSxlXsBBW95habJ6yFv+8cclfQJaeDutiY4dp7g5+AGgw4AK5ZQ1rS4QYLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xYFwe1LO; arc=none smtp.client-ip=91.218.175.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xYFwe1LO" Date: Tue, 11 Aug 2026 22:39:19 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786480763; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RvPs6sQdn1xCyxnV2mIq9/3mrxy3ZXv46BUvWDd2oFs=; b=xYFwe1LO+DpDHnFuOW7LA9/36w6d5AkDBgpMizyBvMLL39z7Gf3RiWHi/mLFNJMC+RZtw+ CxOxiQ2Ln5khGyBXz5J4RhwP5cyyji5nufs7eiTauLRBNelKYn1bm5tUOzxZvgF45cvN0k eLodpIsZ2owkt6LGtj/kYhBHENCEnZo= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Thorsten Blum To: Mark Pearson Cc: "Derek J . Clark" , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , stable@vger.kernel.org, "platform-driver-x86@vger.kernel.org" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] platform/x86: think-lmi: Keep pending save state on failure Message-ID: References: <20260810120830.149804-3-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Tue, Aug 11, 2026 at 03:29:16PM -0400, Mark Pearson wrote: > Hi Thorsten, > > On Mon, Aug 10, 2026, at 8:08 AM, Thorsten Blum wrote: > > 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 > > --- > > 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; > > Curious - have you actually hit this condition? No, I was just reading the code and wondered why those return values aren't checked for errors.