net: ethernet: mediatek: add missing of_node_put() in mtk_sgmii_init()

commit ff5265d453 upstream.

The node pointer returned by of_parse_phandle() with refcount incremented,
so add of_node_put() after using it in mtk_sgmii_init().

Fixes: 9ffee4a827 ("net: ethernet: mediatek: Extend SGMII related functions")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220428062543.64883-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Yang Yingliang 2022-04-28 14:25:43 +08:00 коммит произвёл Greg Kroah-Hartman
Родитель d34f9bbc1d
Коммит bd7e519ff7
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -26,6 +26,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *r, u32 ana_rgc3)
break; break;
ss->regmap[i] = syscon_node_to_regmap(np); ss->regmap[i] = syscon_node_to_regmap(np);
of_node_put(np);
if (IS_ERR(ss->regmap[i])) if (IS_ERR(ss->regmap[i]))
return PTR_ERR(ss->regmap[i]); return PTR_ERR(ss->regmap[i]);
} }