Commit c3194949 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

usb: typec: intel_pmc_mux: Don't leak the ACPI device reference count

When acpi_dev_get_memory_resources() fails, the reference count is
left bumped. Drop it as it's done in the other error paths.

Fixes: 43d596e3 ("usb: typec: intel_pmc_mux: Check the port status before connect")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20230102202933.15968-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ccb0beb4
...@@ -614,8 +614,10 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc) ...@@ -614,8 +614,10 @@ static int pmc_usb_probe_iom(struct pmc_usb *pmc)
INIT_LIST_HEAD(&resource_list); INIT_LIST_HEAD(&resource_list);
ret = acpi_dev_get_memory_resources(adev, &resource_list); ret = acpi_dev_get_memory_resources(adev, &resource_list);
if (ret < 0) if (ret < 0) {
acpi_dev_put(adev);
return ret; return ret;
}
rentry = list_first_entry_or_null(&resource_list, struct resource_entry, node); rentry = list_first_entry_or_null(&resource_list, struct resource_entry, node);
if (rentry) if (rentry)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment