net: ethernet: mtk_wed: Fix missing of_node_put() in mtk_wed_wo_hardware_init()
Subsystems (4)
PATCH v2 1/1 net: ethernet: mtk_wed: Fix missing of_node_put() in mtk_wed_wo_hardware_init()
The np needs to be released through of_node_put() in the error handling path of mtk_wed_wo_hardware_init().
---
Changes in v2:
- Replace IS_ERR_OR_NULL() with IS_ERR() to check wo->mmio.regs.
- Add net-next tag.
drivers/net/ethernet/mediatek/mtk_wed_wo.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/mediatek/mtk_wed_wo.c +6 -3
@@ -407,8 +407,10 @@ mtk_wed_wo_hardware_init(struct mtk_wed_wo *wo)return -ENODEV ; wo->mmio.regs =syscon_regmap_lookup_by_phandle (np,NULL ); -if (IS_ERR_OR_NULL (wo->mmio.regs)) -return PTR_ERR (wo->mmio.regs); +if (IS_ERR (wo->mmio.regs)) { + ret =PTR_ERR (wo->mmio.regs); + goto error_put; + } wo->mmio.irq =irq_of_parse_and_map (np,0 ); wo->mmio.irq_mask =MTK_WED_WO_ALL_INT_MASK ;
@@ -456,7 +458,8 @@ mtk_wed_wo_hardware_init(struct mtk_wed_wo *wo) error:devm_free_irq (wo->hw->dev, wo->mmio.irq, wo); - +error_put: +of_node_put (np);return ret; }
Signature · 1 line
2.17.1
Quoted 5 lines · Yuan Can
The np needs to be released through
of_node_put()in the error handling path ofmtk_wed_wo_hardware_init().Fixes 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support")Signed-off-by Yuan Can <[email protected]>
Quoted 8 lines
---
Changes in v2:
- ReplaceIS_ERR_OR_NULL()withIS_ERR()to checkwo->mmio.regs.
- Add net-next tag.drivers/net/ethernet/mediatek/mtk_wed_wo.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Thanks,
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:
Quoted 11 lines · On Mon, 5 Dec 2022 03:43:39 +0000 you wrote:
The np needs to be released through
of_node_put()in the error handling path ofmtk_wed_wo_hardware_init().Fixes 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support")Signed-off-by Yuan Can <[email protected]>---
Changes in v2:
- ReplaceIS_ERR_OR_NULL()withIS_ERR()to checkwo->mmio.regs.
- Add net-next tag.[...]
Here is the summary with links:
- [net-next,v2] net: ethernet: mtk_wed: Fix missing of_node_put() in mtk_wed_wo_hardware_init()
https://git.kernel.org/netdev/net-next/c/e22dcbc9aa32
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html