OSDN Git Service

net: phy: mscc: fix memory leak in vsc8574_config_pre_init
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Tue, 16 Oct 2018 17:37:35 +0000 (19:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 Oct 2018 05:08:55 +0000 (22:08 -0700)
commit47d20212aa1c64f52aba0c5409d03c22bf25cd66
tree0e58e9ab8b78310f52274ad50164542e543c6271
parente519869af368fe1da218b43bdb3a553d66f4fcd0
net: phy: mscc: fix memory leak in vsc8574_config_pre_init

In case memory resources for *fw* were successfully allocated,
release them before return.

Addresses-Coverity-ID: 1473968 ("Resource leak")
Fixes: 00d70d8e0e78 ("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>
drivers/net/phy/mscc.c