net: cpsw: add missing of_node_put() in cpsw_probe_dt()
commit 95098d5ac2551769807031444e55a0da5d4f0952 upstream.
'tmp_node' need be put before returning from cpsw_probe_dt(),
so add missing of_node_put() in error path.
Fixes: ed3525eda4
("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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
4eee980950
commit
8459485db7
@@ -1255,8 +1255,10 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
|
|||||||
data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
|
data->slave_data = devm_kcalloc(dev, CPSW_SLAVE_PORTS_NUM,
|
||||||
sizeof(struct cpsw_slave_data),
|
sizeof(struct cpsw_slave_data),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!data->slave_data)
|
if (!data->slave_data) {
|
||||||
|
of_node_put(tmp_node);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
/* Populate all the child nodes here...
|
/* Populate all the child nodes here...
|
||||||
*/
|
*/
|
||||||
@@ -1353,6 +1355,7 @@ static int cpsw_probe_dt(struct cpsw_common *cpsw)
|
|||||||
|
|
||||||
err_node_put:
|
err_node_put:
|
||||||
of_node_put(port_np);
|
of_node_put(port_np);
|
||||||
|
of_node_put(tmp_node);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user