Skip to content

Commit 1cffb1c

Browse files
fancergregkh
authored andcommitted
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. Fixes: a4333c3 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Link: https://lore.kernel.org/r/20210212205521.14280-1-Sergey.Semin@baikalelectronics.ru Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9de2c43 commit 1cffb1c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/usb/dwc3/dwc3-qcom.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,16 +653,19 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev)
653653
ret = of_platform_populate(np, NULL, NULL, dev);
654654
if (ret) {
655655
dev_err(dev, "failed to register dwc3 core - %d\n", ret);
656-
return ret;
656+
goto node_put;
657657
}
658658

659659
qcom->dwc3 = of_find_device_by_node(dwc3_np);
660660
if (!qcom->dwc3) {
661+
ret = -ENODEV;
661662
dev_err(dev, "failed to get dwc3 platform device\n");
662-
return -ENODEV;
663663
}
664664

665-
return 0;
665+
node_put:
666+
of_node_put(dwc3_np);
667+
668+
return ret;
666669
}
667670

668671
static struct platform_device *

0 commit comments

Comments
 (0)