FAILED: patch "[PATCH] usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement" failed to apply to 4.19-stable tree
[email protected]
maintainerThe patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 1cffb1c66499a9db9a735473778abf8427d16287 Mon Sep 17 00:00:00 2001
From: Serge Semin <[email protected]>
Date: Fri, 12 Feb 2021 23:55:19 +0300
Subject: [PATCH] usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement
of_get_child_by_name() increments the reference counter of the OF node it managed to find. So after the code is done using the device node, the refcount must be decremented. Add missing of_node_put() invocation then to the dwc3_qcom_of_register_core() method, since DWC3 OF node is being used only there.
drivers/usb/dwc3/dwc3-qcom.c +6 -3
@@ -653,16 +653,19 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev) ret =of_platform_populate (np,NULL ,NULL , dev);if (ret) {dev_err (dev,"failed to register dwc3 core - %d\n" , ret); -return ret; + goto node_put; } qcom->dwc3 =of_find_device_by_node (dwc3_np);if (!qcom->dwc3) { + ret = -ENODEV ;dev_err (dev,"failed to get dwc3 platform device\n" ); -return -ENODEV ; } -return 0 ; +node_put: +of_node_put (dwc3_np); + +return ret; } static struct platform_device *