summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-04-28 17:53:17 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-05-12 12:25:40 +0200
commit2347e9c922709990cd79fc43695bb75d0b75b813 (patch)
treeeef0543b8c4ce04e2fd24661f9b41c6689dace2c
parent1092656cc4ca4a0c965218d672dcd66f9d0e46f4 (diff)
downloadlinux-2347e9c922709990cd79fc43695bb75d0b75b813.tar.gz
linux-2347e9c922709990cd79fc43695bb75d0b75b813.tar.bz2
linux-2347e9c922709990cd79fc43695bb75d0b75b813.zip
net: dsa: mt7530: add missing of_node_put() in mt7530_setup()
commit a9e9b091a1c14ecd8bd9d3214a62142a1786fe30 upstream. Add of_node_put() if of_get_phy_mode() fails in mt7530_setup() Fixes: 0c65b2b90d13 ("net: of_get_phy_mode: Change API to solve int/unit warnings") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20220428095317.538829-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/dsa/mt7530.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 5ee8809bc271..c355824ddb81 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1663,6 +1663,7 @@ mt7530_setup(struct dsa_switch *ds)
ret = of_get_phy_mode(mac_np, &interface);
if (ret && ret != -ENODEV) {
of_node_put(mac_np);
+ of_node_put(phy_node);
return ret;
}
id = of_mdio_parse_addr(ds->dev, phy_node);