mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 17:42:03 +02:00
platform/x86: ishtp_eclite: Fix ACPI device reference leak in probe error path
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: 7b6bf51de9 ("platform/x86: Add Intel ishtp eclite driver")
Link: https://patch.msgid.link/20260624014910.1226446-1-make_ruc2021@163.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
parent
14deb40886
commit
62b57396c2
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user