From: Andrew Halaney <ahalaney@redhat.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <felipe.balbi@linux.intel.com>,
Lee Jones <lee@kernel.org>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()
Date: Thu, 8 Jun 2023 12:09:53 -0500 [thread overview]
Message-ID: <20230608170953.nbemo4cuipq5ui7h@halaney-x13s> (raw)
In-Reply-To: <c0215a84cdf18fb3514c81842783ec53cf149deb.1685891059.git.christophe.jaillet@wanadoo.fr>
On Sun, Jun 04, 2023 at 05:04:37PM +0200, Christophe JAILLET wrote:
> In the probe, some resources are allocated with
> dwc3_qcom_of_register_core() or dwc3_qcom_acpi_register_core(). The
> corresponding resources are already coorectly freed in the error handling
nit not worthy of holding this up: s/coorectly/correctly/
> path of the probe, but not in the remove function.
>
> Fix it.
>
> Fixes: 2bc02355f8ba ("usb: dwc3: qcom: Add support for booting with ACPI")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Thanks,
Andrew
> ---
> drivers/usb/dwc3/dwc3-qcom.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index aa96c473f839..9c95f1d909ba 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -942,11 +942,15 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
> static void dwc3_qcom_remove(struct platform_device *pdev)
> {
> struct dwc3_qcom *qcom = platform_get_drvdata(pdev);
> + struct device_node *np = pdev->dev.of_node;
> struct device *dev = &pdev->dev;
> int i;
>
> device_remove_software_node(&qcom->dwc3->dev);
> - of_platform_depopulate(dev);
> + if (np)
> + of_platform_depopulate(&pdev->dev);
> + else
> + platform_device_put(pdev);
>
> for (i = qcom->num_clocks - 1; i >= 0; i--) {
> clk_disable_unprepare(qcom->clks[i]);
> --
> 2.34.1
>
prev parent reply other threads:[~2023-06-08 17:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-04 15:04 Christophe JAILLET
2023-06-08 17:09 ` Andrew Halaney [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=20230608170953.nbemo4cuipq5ui7h@halaney-x13s \
--to=ahalaney@redhat.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=felipe.balbi@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=lee@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/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
all inboxes | Powered by JetHome®