usb: dwc3: qcom: Fix memory leak in dwc3_qcom_interconnect_init
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 6 Dec 2022 08:17:31 +0000 (12:17 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:33:10 +0000 (13:33 +0100)
commit2f3b51189f7a7be5d822fb8c537d778c57eb9821
treee6d1b036ccdf95e8f1f598188f3e17e9dbed7579
parent2fd6ad7bc56049ce10c1cd3325905be1116df580
usb: dwc3: qcom: Fix memory leak in dwc3_qcom_interconnect_init

commit 97a48da1619ba6bd42a0e5da0a03aa490a9496b1 upstream.

of_icc_get() alloc resources for path handle, we should release it when not
need anymore. Like the release in dwc3_qcom_interconnect_exit() function.
Add icc_put() in error handling to fix this.

Fixes: bea46b981515 ("usb: dwc3: qcom: Add interconnect support in dwc3 driver")
Cc: stable <stable@kernel.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20221206081731.818107-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/dwc3-qcom.c