mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
dpaa2-ptp: Fix refcount leak in dpaa2_ptp_probe
[ Upstream commit 2b04bd4f03bba021959ca339314f6739710f0954 ]
This node pointer is returned by of_find_compatible_node() with
refcount incremented. Calling of_node_put() to aovid the refcount leak.
Fixes: d346c9e86d ("dpaa2-ptp: reuse ptp_qoriq driver")
Signed-off-by: Miaoqian Lin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
8a50937227
commit
fbe5f4c0dd
1 changed files with 3 additions and 1 deletions
|
|
@ -148,7 +148,7 @@ static int dpaa2_ptp_probe(struct fsl_mc_device *mc_dev)
|
|||
base = of_iomap(node, 0);
|
||||
if (!base) {
|
||||
err = -ENOMEM;
|
||||
goto err_close;
|
||||
goto err_put;
|
||||
}
|
||||
|
||||
err = fsl_mc_allocate_irqs(mc_dev);
|
||||
|
|
@ -191,6 +191,8 @@ err_free_mc_irq:
|
|||
fsl_mc_free_irqs(mc_dev);
|
||||
err_unmap:
|
||||
iounmap(base);
|
||||
err_put:
|
||||
of_node_put(node);
|
||||
err_close:
|
||||
dprtc_close(mc_dev->mc_io, 0, mc_dev->mc_handle);
|
||||
err_free_mcp:
|
||||
|
|
|
|||
Loading…
Reference in a new issue