]> git.baikalelectronics.ru Git - kernel.git/commit
of_mdio: fix device reference leak in of_phy_find_device
authorJohan Hovold <johan@kernel.org>
Wed, 16 Nov 2016 14:20:37 +0000 (15:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 Nov 2016 17:05:04 +0000 (12:05 -0500)
commitc2f6828be6092e9acf006b8496eb7f8046707e68
tree9e65dc4f80eb0f1a69eff5e556e72ff883992fa7
parentb72d7f76995c871f3a323643130e481c272fe217
of_mdio: fix device reference leak in of_phy_find_device

Make sure to drop the reference taken by bus_find_device() before
returning NULL from of_phy_find_device() when the found device is not a
PHY.

Fixes: 55609f8618b1 ("of: of_mdio: Ensure mdio device is a PHY")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_mdio.c