Patch "usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-dwc3-qcom-release-the-correct-resources-in-dwc3_.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 60f2f5faedb22fb1ad6fa5d30d485b819d00dd67
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Sun Jun 4 17:04:37 2023 +0200

    usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()
    
    [ Upstream commit 8fd95da2cfb5046c4bb5a3cdc9eb7963ba8b10dd ]
    
    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
    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@xxxxxxxxxx>
    Reviewed-by: Andrew Halaney <ahalaney@xxxxxxxxxx>
    Message-ID: <c0215a84cdf18fb3514c81842783ec53cf149deb.1685891059.git.christophe.jaillet@xxxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index d7222c8cb0060..a699986b56c4b 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -874,11 +874,15 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
 static int 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]);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux