Re: [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks

From: Timur Tabi
Date: Thu Nov 24 2016 - 13:55:38 EST


Johan Hovold wrote:
Make sure to drop the reference taken by of_phy_find_device() during
probe on probe errors and on driver unbind.

Also drop the of_node reference taken by of_parse_phandle() in the same
path.

Fixes: b9b17debc69d ("net: emac: emac gigabit ethernet controller driver")
Signed-off-by: Johan Hovold<johan@xxxxxxxxxx>

When I first wrote this code, I had a lot of trouble getting the PHY to re-probe when the driver was unloaded and reloaded, and it was because of some odd problems with get/put of of_nodes.

Since I know that you didn't test this driver on real hardware, I have to test these patches myself before I can ACK them.

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.