]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 11:05:29 +0000 (13:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 11:05:29 +0000 (13:05 +0200)
added patches:
net-cpsw-add-missing-of_node_put-in-cpsw_probe_dt.patch
net-dsa-mt7530-add-missing-of_node_put-in-mt7530_setup.patch
net-emaclite-add-error-handling-for-of_address_to_resource.patch
net-ethernet-mediatek-add-missing-of_node_put-in-mtk_sgmii_init.patch
net-stmmac-dwmac-sun8i-add-missing-of_node_put-in-sun8i_dwmac_register_mdio_mux.patch

queue-5.10/net-cpsw-add-missing-of_node_put-in-cpsw_probe_dt.patch [new file with mode: 0644]
queue-5.10/net-dsa-mt7530-add-missing-of_node_put-in-mt7530_setup.patch [new file with mode: 0644]
queue-5.10/net-emaclite-add-error-handling-for-of_address_to_resource.patch [new file with mode: 0644]
queue-5.10/net-ethernet-mediatek-add-missing-of_node_put-in-mtk_sgmii_init.patch [new file with mode: 0644]
queue-5.10/net-stmmac-dwmac-sun8i-add-missing-of_node_put-in-sun8i_dwmac_register_mdio_mux.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/net-cpsw-add-missing-of_node_put-in-cpsw_probe_dt.patch b/queue-5.10/net-cpsw-add-missing-of_node_put-in-cpsw_probe_dt.patch
new file mode 100644 (file)
index 0000000..6e647b2
--- /dev/null
@@ -0,0 +1,42 @@
+From 95098d5ac2551769807031444e55a0da5d4f0952 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Fri, 29 Apr 2022 09:53:37 +0800
+Subject: net: cpsw: add missing of_node_put() in cpsw_probe_dt()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 95098d5ac2551769807031444e55a0da5d4f0952 upstream.
+
+'tmp_node' need be put before returning from cpsw_probe_dt(),
+so add missing of_node_put() in error path.
+
+Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/ti/cpsw_new.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/ti/cpsw_new.c
++++ b/drivers/net/ethernet/ti/cpsw_new.c
+@@ -1255,8 +1255,10 @@ static int cpsw_probe_dt(struct cpsw_com
+       data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
+                                       sizeof(struct cpsw_slave_data),
+                                       GFP_KERNEL);
+-      if (!data->slave_data)
++      if (!data->slave_data) {
++              of_node_put(tmp_node);
+               return -ENOMEM;
++      }
+       /* Populate all the child nodes here...
+        */
+@@ -1353,6 +1355,7 @@ static int cpsw_probe_dt(struct cpsw_com
+ err_node_put:
+       of_node_put(port_np);
++      of_node_put(tmp_node);
+       return ret;
+ }
diff --git a/queue-5.10/net-dsa-mt7530-add-missing-of_node_put-in-mt7530_setup.patch b/queue-5.10/net-dsa-mt7530-add-missing-of_node_put-in-mt7530_setup.patch
new file mode 100644 (file)
index 0000000..c4d7eea
--- /dev/null
@@ -0,0 +1,31 @@
+From a9e9b091a1c14ecd8bd9d3214a62142a1786fe30 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Thu, 28 Apr 2022 17:53:17 +0800
+Subject: net: dsa: mt7530: add missing of_node_put() in mt7530_setup()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+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>
+---
+ drivers/net/dsa/mt7530.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- 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);
diff --git a/queue-5.10/net-emaclite-add-error-handling-for-of_address_to_resource.patch b/queue-5.10/net-emaclite-add-error-handling-for-of_address_to_resource.patch
new file mode 100644 (file)
index 0000000..13ace88
--- /dev/null
@@ -0,0 +1,77 @@
+From 7a6bc33ab54923d325d9a1747ec9652c4361ebd1 Mon Sep 17 00:00:00 2001
+From: Shravya Kumbham <shravya.kumbham@xilinx.com>
+Date: Mon, 2 May 2022 12:57:50 +0530
+Subject: net: emaclite: Add error handling for of_address_to_resource()
+
+From: Shravya Kumbham <shravya.kumbham@xilinx.com>
+
+commit 7a6bc33ab54923d325d9a1747ec9652c4361ebd1 upstream.
+
+check the return value of of_address_to_resource() and also add
+missing of_node_put() for np and npp nodes.
+
+Fixes: e0a3bc65448c ("net: emaclite: Support multiple phys connected to one MDIO bus")
+Addresses-Coverity: Event check_return value.
+Signed-off-by: Shravya Kumbham <shravya.kumbham@xilinx.com>
+Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/xilinx/xilinx_emaclite.c |   15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
++++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+@@ -820,10 +820,10 @@ static int xemaclite_mdio_write(struct m
+ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
+ {
+       struct mii_bus *bus;
+-      int rc;
+       struct resource res;
+       struct device_node *np = of_get_parent(lp->phy_node);
+       struct device_node *npp;
++      int rc, ret;
+       /* Don't register the MDIO bus if the phy_node or its parent node
+        * can't be found.
+@@ -833,8 +833,14 @@ static int xemaclite_mdio_setup(struct n
+               return -ENODEV;
+       }
+       npp = of_get_parent(np);
+-
+-      of_address_to_resource(npp, 0, &res);
++      ret = of_address_to_resource(npp, 0, &res);
++      of_node_put(npp);
++      if (ret) {
++              dev_err(dev, "%s resource error!\n",
++                      dev->of_node->full_name);
++              of_node_put(np);
++              return ret;
++      }
+       if (lp->ndev->mem_start != res.start) {
+               struct phy_device *phydev;
+               phydev = of_phy_find_device(lp->phy_node);
+@@ -843,6 +849,7 @@ static int xemaclite_mdio_setup(struct n
+                                "MDIO of the phy is not registered yet\n");
+               else
+                       put_device(&phydev->mdio.dev);
++              of_node_put(np);
+               return 0;
+       }
+@@ -855,6 +862,7 @@ static int xemaclite_mdio_setup(struct n
+       bus = mdiobus_alloc();
+       if (!bus) {
+               dev_err(dev, "Failed to allocate mdiobus\n");
++              of_node_put(np);
+               return -ENOMEM;
+       }
+@@ -867,6 +875,7 @@ static int xemaclite_mdio_setup(struct n
+       bus->parent = dev;
+       rc = of_mdiobus_register(bus, np);
++      of_node_put(np);
+       if (rc) {
+               dev_err(dev, "Failed to register mdio bus.\n");
+               goto err_register;
diff --git a/queue-5.10/net-ethernet-mediatek-add-missing-of_node_put-in-mtk_sgmii_init.patch b/queue-5.10/net-ethernet-mediatek-add-missing-of_node_put-in-mtk_sgmii_init.patch
new file mode 100644 (file)
index 0000000..fe5b5ce
--- /dev/null
@@ -0,0 +1,31 @@
+From ff5265d45345d01fefc98fcb9ae891b59633c919 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Thu, 28 Apr 2022 14:25:43 +0800
+Subject: net: ethernet: mediatek: add missing of_node_put() in mtk_sgmii_init()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit ff5265d45345d01fefc98fcb9ae891b59633c919 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: 9ffee4a8276c ("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>
+---
+ drivers/net/ethernet/mediatek/mtk_sgmii.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
++++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
+@@ -26,6 +26,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
+                       break;
+               ss->regmap[i] = syscon_node_to_regmap(np);
++              of_node_put(np);
+               if (IS_ERR(ss->regmap[i]))
+                       return PTR_ERR(ss->regmap[i]);
+       }
diff --git a/queue-5.10/net-stmmac-dwmac-sun8i-add-missing-of_node_put-in-sun8i_dwmac_register_mdio_mux.patch b/queue-5.10/net-stmmac-dwmac-sun8i-add-missing-of_node_put-in-sun8i_dwmac_register_mdio_mux.patch
new file mode 100644 (file)
index 0000000..369f0e7
--- /dev/null
@@ -0,0 +1,32 @@
+From 1a15267b7be77e0792cf0c7b36ca65c8eb2df0d8 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Thu, 28 Apr 2022 17:57:16 +0800
+Subject: net: stmmac: dwmac-sun8i: add missing of_node_put() in sun8i_dwmac_register_mdio_mux()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 1a15267b7be77e0792cf0c7b36ca65c8eb2df0d8 upstream.
+
+The node pointer returned by of_get_child_by_name() with refcount incremented,
+so add of_node_put() after using it.
+
+Fixes: 634db83b8265 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs")
+Reported-by: Hulk Robot <hulkci@huawei.com>
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Link: https://lore.kernel.org/r/20220428095716.540452-1-yangyingliang@huawei.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
+@@ -895,6 +895,7 @@ static int sun8i_dwmac_register_mdio_mux
+       ret = mdio_mux_init(priv->device, mdio_mux, mdio_mux_syscon_switch_fn,
+                           &gmac->mux_handle, priv, priv->mii);
++      of_node_put(mdio_mux);
+       return ret;
+ }
index b413cecd6ed13147eff1239278c0993659336609..c0b9fb3f276e3ad5d2f200d0c27cbbe8cfa28075 100644 (file)
@@ -43,3 +43,8 @@ net-mlx5-avoid-double-clear-or-set-of-sync-reset-requested.patch
 selftests-seccomp-don-t-call-read-on-tty-from-background-pgrp.patch
 rdma-siw-fix-a-condition-race-issue-in-mpa-request-processing.patch
 nfsv4-don-t-invalidate-inode-attributes-on-delegation-return.patch
+net-ethernet-mediatek-add-missing-of_node_put-in-mtk_sgmii_init.patch
+net-dsa-mt7530-add-missing-of_node_put-in-mt7530_setup.patch
+net-stmmac-dwmac-sun8i-add-missing-of_node_put-in-sun8i_dwmac_register_mdio_mux.patch
+net-cpsw-add-missing-of_node_put-in-cpsw_probe_dt.patch
+net-emaclite-add-error-handling-for-of_address_to_resource.patch