[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <760b7678-4fba-8683-3438-d8c6ee1cfc6f@linux.intel.com>
Date: Thu, 29 Aug 2024 16:11:05 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Aleksandr Mishin <amishin@...rgos.ru>
cc: Mario Limonciello <mario.limonciello@...l.com>,
Hans de Goede <hdegoede@...hat.com>, Lyndon Sanche <lsanche@...deno.ca>,
Armin Wolf <W_Armin@....de>, "Darren Hart (VMware)" <dvhart@...radead.org>,
Edward O'Callaghan <quasisec@...gle.com>,
platform-driver-x86@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
lvc-project@...uxtesting.org
Subject: Re: [PATCH] platform/x86: dell-smbios: Fix error path in
dell_smbios_init()
On Wed, 28 Aug 2024, Aleksandr Mishin wrote:
> 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.
>
> Fix this issue by replacing free_group() call with exit_dell_smbios_wmi()
There are two issues and only one is properly described. Please amend the
commit message to cover the other problem too.
--
i.
> 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@...rgos.ru>
> ---
> drivers/platform/x86/dell/dell-smbios-base.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c
> index 6565fac24cde..73e41eb69cb5 100644
> --- a/drivers/platform/x86/dell/dell-smbios-base.c
> +++ b/drivers/platform/x86/dell/dell-smbios-base.c
> @@ -622,7 +622,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);
>
Powered by blists - more mailing lists