linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: wu000273@umn.edu
Cc: Kangjie Lu <kjlu@umn.edu>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>,
	Prashanth Prakash <pprakash@codeaurora.org>,
	Ashwin Chaugule <ashwin.chaugule@linaro.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe.
Date: Thu, 28 May 2020 13:49:40 +0200	[thread overview]
Message-ID: <CAJZ5v0jj60jvU_0C2mpXaK0-eeHwhzSMZCtUpAKJRtjbU2H6Mw@mail.gmail.com> (raw)
In-Reply-To: <20200527223551.20156-1-wu000273@umn.edu>

On Thu, May 28, 2020 at 12:45 AM <wu000273@umn.edu> wrote:
>
> From: Qiushi Wu <wu000273@umn.edu>
>
> kobject_init_and_add() takes reference even when it fails.
> If this function returns an error, kobject_put() must be called to
> properly clean up the memory associated with the object. Previous
> commit "b8eb718348b8" fixed a similar problem.
>
> Fixes: 158c998ea44b ("ACPI / CPPC: add sysfs support to compute delivered performance")
> Signed-off-by: Qiushi Wu <wu000273@umn.edu>
> ---
>  drivers/acpi/cppc_acpi.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
> index 8b2e89c20c11..067067bc03d4 100644
> --- a/drivers/acpi/cppc_acpi.c
> +++ b/drivers/acpi/cppc_acpi.c
> @@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
>                         "acpi_cppc");
>         if (ret) {
>                 per_cpu(cpc_desc_ptr, pr->id) = NULL;
> +               kobject_put(&cpc_ptr->kobj);
>                 goto out_free;
>         }
>
> --

Applied as 5.8 material, thanks!

      reply	other threads:[~2020-05-28 11:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 22:35 [PATCH] ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe wu000273
2020-05-28 11:49 ` Rafael J. Wysocki [this message]

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=CAJZ5v0jj60jvU_0C2mpXaK0-eeHwhzSMZCtUpAKJRtjbU2H6Mw@mail.gmail.com \
    --to=rafael@kernel.org \
    --cc=ashwin.chaugule@linaro.org \
    --cc=kjlu@umn.edu \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pprakash@codeaurora.org \
    --cc=rjw@rjwysocki.net \
    --cc=wu000273@umn.edu \
    /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;
as well as URLs for NNTP newsgroup(s).