diff options
author | Johan Hovold <johan@kernel.org> | 2016-11-24 19:21:29 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-27 20:01:15 -0500 |
commit | 966830340302fd79c51e2a3b9bccca9427256dee (patch) | |
tree | 9fb4e0eeba1a2b5acb836f04c60c9116d67a50b0 /drivers/net/ethernet/freescale/fman | |
parent | 0da60541f8a771270d310a574cb0adeefcdebcb1 (diff) | |
download | linux-966830340302fd79c51e2a3b9bccca9427256dee.tar.bz2 |
net: fsl/fman: fix phydev reference leak
Make sure to drop the reference taken by of_phy_find_device() during
initialisation when later freeing the struct fman_mac.
Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/freescale/fman')
-rw-r--r-- | drivers/net/ethernet/freescale/fman/fman_memac.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fman/fman_memac.c b/drivers/net/ethernet/freescale/fman/fman_memac.c index 53ef51e3bd9e..71a5ded9d1de 100644 --- a/drivers/net/ethernet/freescale/fman/fman_memac.c +++ b/drivers/net/ethernet/freescale/fman/fman_memac.c @@ -1107,6 +1107,9 @@ int memac_free(struct fman_mac *memac) { free_init_resources(memac); + if (memac->pcsphy) + put_device(&memac->pcsphy->mdio.dev); + kfree(memac->memac_drv_param); kfree(memac); |