WSL2-Linux-Kernel/drivers/platform
Aleksandr Mishin cff3cbba73 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: 33b9ca1e53 ("platform/x86: dell-smbios: Add a sysfs interface for SMBIOS tokens")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://lore.kernel.org/r/20240830065428.9544-1-amishin@t-argos.ru
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:07:47 +02:00
..
chrome platform/chrome: cros_ec_proto: Lock device when updating MKBP version 2024-08-19 05:45:33 +02:00
goldfish
mellanox platform/mellanox: Check devm_hwmon_device_register_with_groups() return value 2023-12-13 18:36:35 +01:00
mips platform: mips: cpu_hwmon: Disable driver on unsupported hardware 2024-08-19 05:45:20 +02:00
olpc
surface platform/surface: aggregator: Fix warning when controller is destroyed in probe 2024-09-04 13:23:31 +02:00
x86 platform/x86: dell-smbios: Fix error path in dell_smbios_init() 2024-09-12 11:07:47 +02:00
Kconfig
Makefile