summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorWang Ming <machel@vivo.com>2023-07-17 18:11:02 +0800
committerHans de Goede <hdegoede@redhat.com>2023-07-25 15:30:57 +0200
commit1da0893aed2e48e2bdf37c29b029f2e060d25927 (patch)
tree4bd1b1a61f42a4bb7b945104530cef708b2d6472 /drivers/platform
parent7783e97f8558ad7a4d1748922461bc88483fbcdf (diff)
platform/x86: think-lmi: Use kfree_sensitive instead of kfree
key might contain private part of the key, so better use kfree_sensitive to free it. Signed-off-by: Wang Ming <machel@vivo.com> Link: https://lore.kernel.org/r/20230717101114.18966-1-machel@vivo.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/think-lmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
index 52d1ce8dfe44..79346881cadb 100644
--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -719,12 +719,12 @@ static ssize_t cert_to_password_store(struct kobject *kobj,
/* Format: 'Password,Signature' */
auth_str = kasprintf(GFP_KERNEL, "%s,%s", passwd, setting->signature);
if (!auth_str) {
- kfree(passwd);
+ kfree_sensitive(passwd);
return -ENOMEM;
}
ret = tlmi_simple_call(LENOVO_CERT_TO_PASSWORD_GUID, auth_str);
kfree(auth_str);
- kfree(passwd);
+ kfree_sensitive(passwd);
return ret ?: count;
}