summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorClément Léger <clement.leger@bootlin.com>2023-01-31 11:02:42 +0100
committerDavid S. Miller <davem@davemloft.net>2023-02-03 09:13:53 +0000
commitce93fdb5f2ca5c9e2a9668411cc39091507f8dc9 (patch)
treec6dc4f05a63c75031677976545deb6c6b81ef96b /tools/perf/scripts/python/export-to-sqlite.py
parentedb9b8f380c3413bf783475279b1a941c7e5cec1 (diff)
net: phylink: move phy_device_free() to correctly release phy device
After calling fwnode_phy_find_device(), the phy device refcount is incremented. Then, when the phy device is attached to a netdev with phy_attach_direct(), the refcount is also incremented but only decremented in the caller if phy_attach_direct() fails. Move phy_device_free() before the "if" to always release it correctly. Indeed, either phy_attach_direct() failed and we don't want to keep a reference to the phydev or it succeeded and a reference has been taken internally. Fixes: 25396f680dd6 ("net: phylink: introduce phylink_fwnode_phy_connect()") Signed-off-by: Clément Léger <clement.leger@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions