Skip to content

Commit ffc17e1

Browse files
Aleksandr Mishinij-intel
authored andcommitted
platform/x86: dell-smbios: Fix error path in dell_smbios_init()
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: 33b9ca1 ("platform/x86: dell-smbios: Add a sysfs interface for SMBIOS tokens") Signed-off-by: Aleksandr Mishin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent a3379ec commit ffc17e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/platform/x86/dell/dell-smbios-base.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,10 @@ static int __init dell_smbios_init(void)
622622
return 0;
623623

624624
fail_sysfs:
625-
free_group(platform_device);
625+
if (!wmi)
626+
exit_dell_smbios_wmi();
627+
if (!smm)
628+
exit_dell_smbios_smm();
626629

627630
fail_create_group:
628631
platform_device_del(platform_device);

0 commit comments

Comments
 (0)