]> www.infradead.org Git - users/jedix/linux-maple.git/commit
usb: dwc3: st: Add of_dev_put() in probe function
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Mon, 19 Aug 2019 07:24:36 +0000 (12:54 +0530)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 28 Aug 2019 10:04:58 +0000 (13:04 +0300)
commitbceb418b65b917af6d36a92ea1eaca54cafc1c2e
treecfc494b845255f516b5b01ebc7a9e29658090ae5
parente36721b90144bb46e1b6477be3ab63439c7fb79b
usb: dwc3: st: Add of_dev_put() in probe function

In function st_dwc3_probe, variable child_pdev takes the value returned
by of_find_device_by_node, which gets a device pointer but does not put
it. If child_pdev is not put before the probe function returns, it may
cause a reference leak. Hence put child_pdev after its last usage.
Issue found with Coccinelle.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-st.c