Commit e409d734 authored by Jan Kiszka's avatar Jan Kiszka Committed by David S. Miller

net: ti: icssg-prueth: Add missing icss_iep_put to error path

Analogously to prueth_remove, just also taking care for NULL'ing the
iep pointers.

Fixes: 186734c1 ("net: ti: icssg-prueth: add packet timestamping and ptp support")
Fixes: 443a2367 ("net: ti: icssg-prueth: am65x SR2.0 add 10M full duplex support")
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: default avatarMD Danish Anwar <danishanwar@ti.com>
Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 71963985
...@@ -2105,10 +2105,7 @@ static int prueth_probe(struct platform_device *pdev) ...@@ -2105,10 +2105,7 @@ static int prueth_probe(struct platform_device *pdev)
prueth->iep1 = icss_iep_get_idx(np, 1); prueth->iep1 = icss_iep_get_idx(np, 1);
if (IS_ERR(prueth->iep1)) { if (IS_ERR(prueth->iep1)) {
ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n"); ret = dev_err_probe(dev, PTR_ERR(prueth->iep1), "iep1 get failed\n");
icss_iep_put(prueth->iep0); goto put_iep0;
prueth->iep0 = NULL;
prueth->iep1 = NULL;
goto free_pool;
} }
if (prueth->pdata.quirk_10m_link_issue) { if (prueth->pdata.quirk_10m_link_issue) {
...@@ -2205,6 +2202,12 @@ static int prueth_probe(struct platform_device *pdev) ...@@ -2205,6 +2202,12 @@ static int prueth_probe(struct platform_device *pdev)
exit_iep: exit_iep:
if (prueth->pdata.quirk_10m_link_issue) if (prueth->pdata.quirk_10m_link_issue)
icss_iep_exit_fw(prueth->iep1); icss_iep_exit_fw(prueth->iep1);
icss_iep_put(prueth->iep1);
put_iep0:
icss_iep_put(prueth->iep0);
prueth->iep0 = NULL;
prueth->iep1 = NULL;
free_pool: free_pool:
gen_pool_free(prueth->sram_pool, gen_pool_free(prueth->sram_pool,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment