mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Aleksandr Mishin <amishin@t-argos.ru>
Cc: Mario Limonciello <mario.limonciello@dell.com>,
	 Hans de Goede <hdegoede@redhat.com>,
	Lyndon Sanche <lsanche@lyndeno.ca>,  Armin Wolf <W_Armin@gmx.de>,
	"Darren Hart (VMware)" <dvhart@infradead.org>,
	 Edward O'Callaghan <quasisec@google.com>,
	 platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	 lvc-project@linuxtesting.org
Subject: Re: [PATCH] platform/x86: dell-smbios: Fix error path in dell_smbios_init()
Date: Thu, 29 Aug 2024 16:11:05 +0300 (EEST)	[thread overview]
Message-ID: <760b7678-4fba-8683-3438-d8c6ee1cfc6f@linux.intel.com> (raw)
In-Reply-To: <20240828121703.17470-1-amishin@t-argos.ru>

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@t-argos.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);
> 


  reply	other threads:[~2024-08-29 13:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-28 12:17 Aleksandr Mishin
2024-08-29 13:11 ` Ilpo Järvinen [this message]
2024-08-30  6:54 ` [PATCH v2] " Aleksandr Mishin
2024-08-30  9:58   ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=760b7678-4fba-8683-3438-d8c6ee1cfc6f@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=W_Armin@gmx.de \
    --cc=amishin@t-argos.ru \
    --cc=dvhart@infradead.org \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsanche@lyndeno.ca \
    --cc=lvc-project@linuxtesting.org \
    --cc=mario.limonciello@dell.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=quasisec@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®