The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Ma Ke <make_ruc2021@163.com>,
	hansg@kernel.org,  ilpo.jarvinen@linux.intel.com,
	sumesh.k.naduvalath@intel.com,  mgross@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,  akpm@linux-foundation.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] platform/x86: ishtp_eclite: Fix ACPI device reference leak in probe error path
Date: Mon, 22 Jun 2026 18:23:08 -0700	[thread overview]
Message-ID: <ec8074628da9ec3e628f4c40fda7ffb3cb8fe001.camel@linux.intel.com> (raw)
In-Reply-To: <20260623010539.2367634-1-make_ruc2021@163.com>

On Tue, 2026-06-23 at 09:05 +0800, Ma Ke wrote:
> ecl_ishtp_cl_probe() acquires a reference to an ACPI device via
> acpi_find_eclite_device() but fails to release it in the error path
> when acpi_opregion_init() fails. This results in a reference count
> leak, preventing proper cleanup of the ACPI device.
> 
> Calling path: acpi_find_eclite_device() ->
> acpi_dev_get_first_match_dev() -> acpi_dev_get_next_match_dev() ->
> bus_find_device() -> get_device().
> 
> Found by code review.
> 
> Signed-off-by: Ma Ke <make_ruc2021@163.com>
> Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: stable@vger.kernel.org
> Fixes: 7b6bf51de974 ("platform/x86: Add Intel ishtp eclite driver")
> ---
Whenever you post a new version, you should add change log here,
showing what is the new in this version.

But here I think you only capitalized the first letter for "Fix".

Thanks,
Srinivas


>  drivers/platform/x86/intel/ishtp_eclite.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel/ishtp_eclite.c
> b/drivers/platform/x86/intel/ishtp_eclite.c
> index 93ac8b2dbf38..bca7e217878b 100644
> --- a/drivers/platform/x86/intel/ishtp_eclite.c
> +++ b/drivers/platform/x86/intel/ishtp_eclite.c
> @@ -600,13 +600,16 @@ static int ecl_ishtp_cl_probe(struct
> ishtp_cl_device *cl_device)
>  	rv = acpi_opregion_init(opr_dev);
>  	if (rv) {
>  		dev_err(cl_data_to_dev(opr_dev), "ACPI opregion init
> failed\n");
> -		goto err_exit;
> +		goto err_put;
>  	}
>  
>  	/* Reprobe devices depending on ECLite - battery, fan, etc.
> */
>  	acpi_dev_clear_dependencies(opr_dev->adev);
>  
>  	return 0;
> +
> +err_put:
> +	acpi_dev_put(opr_dev->adev);
>  err_exit:
>  	ishtp_set_connection_state(ecl_ishtp_cl,
> ISHTP_CL_DISCONNECTING);
>  	ishtp_cl_disconnect(ecl_ishtp_cl);

      reply	other threads:[~2026-06-23  1:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23  1:05 [PATCH v2] platform/x86: ishtp_eclite: Fix ACPI device reference leak in probe error path Ma Ke
2026-06-23  1:23 ` srinivas pandruvada [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=ec8074628da9ec3e628f4c40fda7ffb3cb8fe001.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=make_ruc2021@163.com \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sumesh.k.naduvalath@intel.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