net: systemport: free dev before on error path
Subsystems (3)
PATCH 1/1 net: systemport: free dev before on error path
On the error path, it should goto the error handling label to free allocated memory rather than directly return.
Fixes 6328a126896e ("net: systemport: Manage Wake-on-LAN clock")
Signed-off-by Pan Bian <[email protected]>
--- drivers/net/ethernet/broadcom/bcmsysport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bcmsysport.c +4 -2
@@ -2503,8 +2503,10 @@ static int bcm_sysport_probe(struct platform_device *pdev) priv =netdev_priv (dev); priv->clk =devm_clk_get_optional (&pdev->dev,"sw_sysport" ); -if (IS_ERR (priv->clk)) -return PTR_ERR (priv->clk); +if (IS_ERR (priv->clk)) { + ret =PTR_ERR (priv->clk); + goto err_free_netdev; + }/* Allocate number of TX rings */ priv->tx_rings = devm_kcalloc(&pdev->dev, txq,
Signature · 1 line
2.17.1
Quoted 5 lines · Pan Bian
On the error path, it should goto the error handling label to free allocated memory rather than directly return.
Fixes 6328a126896e ("net: systemport: Manage Wake-on-LAN clock")Signed-off-by Pan Bian <[email protected]>
The change is correct, but not the Fixes tag, it should be:
Fixes 31bc72d97656 ("net: systemport: fetch and use clock resources")
Acked-by Florian Fainelli <[email protected]>
Signature · 1 line
Florian
Quoted 4 lines · On Tue, 19 Jan 2021 21:07:10 -0800 Florian Fainelli wrote:
Quoted 3 lines · Pan Bian
On the error path, it should goto the error handling label to free allocated memory rather than directly return.
Quoted 8 lines
Quoted 2 lines
Fixes 6328a126896e ("net: systemport: Manage Wake-on-LAN clock")Signed-off-by Pan Bian <[email protected]>The change is correct, but not the Fixes tag, it should be:
Fixes 31bc72d97656 ("net: systemport: fetch and use clock resources")Acked-by Florian Fainelli <[email protected]>
Applied, thank you!