Skip to content

Commit

Permalink
net: phy: mscc: fix memory leak in vsc8574_config_pre_init
Browse files Browse the repository at this point in the history
In case memory resources for *fw* were successfully allocated,
release them before return.

Addresses-Coverity-ID: 1473968 ("Resource leak")
Fixes: 00d70d8 ("net: phy: mscc: add support for VSC8574 PHY")
Reviewed-by: Quentin Schulz <quentin.schulz@bootlin.com>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Gustavo A. R. Silva authored and David S. Miller committed Oct 18, 2018
1 parent e519869 commit 47d2021
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/mscc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ static int vsc8574_config_pre_init(struct phy_device *phydev)
dev_err(dev,
"%s: failed to assert reset of micro\n",
__func__);
return ret;
goto out;
}
}
} else {
Expand Down

0 comments on commit 47d2021

Please sign in to comment.