dpaa2-ptp: Fix refcount leak in dpaa2_ptp_probe
Subsystems (3)
PATCH 1/1 dpaa2-ptp: Fix refcount leak in dpaa2_ptp_probe
This node pointer is returned by of_find_compatible_node() with refcount incremented. Calling of_node_put() to aovid the refcount leak.
Fixes d346c9e86d86 ("dpaa2-ptp: reuse ptp_qoriq driver")
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c +3 -1
@@ -167,7 +167,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);
@@ -210,6 +210,8 @@ static int dpaa2_ptp_probe(struct fsl_mc_device *mc_dev)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:
Signature · 1 line
2.17.1
This patch was applied to netdev/net.git (master) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by Paolo Abeni <[email protected]>:
Quoted 8 lines · On Mon, 4 Apr 2022 12:53:36 +0000 you wrote:
This node pointer is returned by
of_find_compatible_node()with refcount incremented. Callingof_node_put()to aovid the refcount leak.Fixes d346c9e86d86 ("dpaa2-ptp: reuse ptp_qoriq driver")Signed-off-by Miaoqian Lin <[email protected]>--- drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Here is the summary with links:
- dpaa2-ptp: Fix refcount leak in dpaa2_ptp_probe
https://git.kernel.org/netdev/net/c/2b04bd4f03bb
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html