]> Git Repo - linux.git/commit
platform/x86: dell-smbios: Fix error path in dell_smbios_init()
authorAleksandr Mishin <[email protected]>
Fri, 30 Aug 2024 06:54:28 +0000 (09:54 +0300)
committerIlpo Järvinen <[email protected]>
Fri, 30 Aug 2024 09:58:18 +0000 (12:58 +0300)
commitffc17e1479e8e9459b7afa80e5d9d40d0dd78abb
treeaefffd31474661b39f4f099306673aad08fe7088
parenta3379eca24a7da5118a7d090da6f8eb8611acac8
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: 33b9ca1e53b4 ("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]>
drivers/platform/x86/dell/dell-smbios-base.c
This page took 0.057025 seconds and 4 git commands to generate.