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 <redacted>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
@@ -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))-returnPTR_ERR(priv->clk);+if(IS_ERR(priv->clk)){+ret=PTR_ERR(priv->clk);+gotoerr_free_netdev;+}/* Allocate number of TX rings */priv->tx_rings=devm_kcalloc(&pdev->dev,txq,
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 <redacted>
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 <f.fainelli@gmail.com>
--
Florian
From: Jakub Kicinski <kuba@kernel.org> Date: 2021-01-20 17:15:47
On Tue, 19 Jan 2021 21:07:10 -0800 Florian Fainelli wrote:
On 1/19/2021 8:44 PM, Pan Bian wrote:
quoted
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 <redacted>
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 <f.fainelli@gmail.com>