aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3/cdns3-pci-wrap.c
diff options
context:
space:
mode:
authorNishka Dasgupta <[email protected]>2019-08-19 07:24:35 +0000
committerFelipe Balbi <[email protected]>2019-08-28 10:04:58 +0000
commite36721b90144bb46e1b6477be3ab63439c7fb79b (patch)
tree7c74576f1fa9f709ac70b2813f546146181399fe /drivers/usb/cdns3/cdns3-pci-wrap.c
parentusb: dwc3: don't set gadget->is_otg flag (diff)
downloadkernel-e36721b90144bb46e1b6477be3ab63439c7fb79b.tar.gz
kernel-e36721b90144bb46e1b6477be3ab63439c7fb79b.zip
usb: dwc3: st: Add of_node_put() before return in probe function
The local variable child in the function st_dwc3_probe takes the return value of of_get_child_by_name, which gets a node and does not put it. If the function returns without releasing child, this could cause a memory error. Hence put child as soon as there is no more use for it. Also create a new label, err_node_put, just before label undo_softreset; so that err_node_put puts child. In between initialisation of child and its first put, modify all statements that go to undo_softreset to now go to err_node_put instead, from where they can fall through to undo_softreset. Issue found with Coccinelle. Reviewed-by: Patrice Chotard <[email protected]> Signed-off-by: Nishka Dasgupta <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-pci-wrap.c')
0 files changed, 0 insertions, 0 deletions