Patch "platform/x86: dell-smbios: Fix error path in dell_smbios_init()" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    platform/x86: dell-smbios: Fix error path in dell_smbios_init()

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     platform-x86-dell-smbios-fix-error-path-in-dell_smbi.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 73634e44e9e896d417d1cdcd9183bb9be67e03aa
Author: Aleksandr Mishin <amishin@xxxxxxxxxx>
Date:   Fri Aug 30 09:54:28 2024 +0300

    platform/x86: dell-smbios: Fix error path in dell_smbios_init()
    
    [ Upstream commit ffc17e1479e8e9459b7afa80e5d9d40d0dd78abb ]
    
    In case of error in build_tokens_sysfs(), all the memory that has been
    allocated is freed at end of this function. But then free_group() is
    called which performs memory deallocation again.
    
    Also, instead of free_group() call, there should be exit_dell_smbios_smm()
    and exit_dell_smbios_wmi() calls, since there is initialization, but there
    is no release of resources in case of an error.
    
    Fix these issues by replacing free_group() call with
    exit_dell_smbios_wmi() and exit_dell_smbios_smm().
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: 33b9ca1e53b4 ("platform/x86: dell-smbios: Add a sysfs interface for SMBIOS tokens")
    Signed-off-by: Aleksandr Mishin <amishin@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20240830065428.9544-1-amishin@xxxxxxxxxx
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c
index b562ed99ec4e..4702669dbb60 100644
--- a/drivers/platform/x86/dell/dell-smbios-base.c
+++ b/drivers/platform/x86/dell/dell-smbios-base.c
@@ -587,7 +587,10 @@ static int __init dell_smbios_init(void)
 	return 0;
 
 fail_sysfs:
-	free_group(platform_device);
+	if (!wmi)
+		exit_dell_smbios_wmi();
+	if (!smm)
+		exit_dell_smbios_smm();
 
 fail_create_group:
 	platform_device_del(platform_device);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux