]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
USB: phy: am335x-control: fix device and of_node leaks
authorJohan Hovold <johan@kernel.org>
Tue, 1 Nov 2016 10:40:25 +0000 (11:40 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Fri, 20 Jan 2017 11:26:44 +0000 (11:26 +0000)
commit23adf7af2915eaff05f92c1dffa47eed1b79fbe8
tree4dabb9e7036b85c5297071d7af21709621fec8dc
parent01ea5c94e5bf517a8761f209d1268c3130582a36
USB: phy: am335x-control: fix device and of_node leaks

BugLink: http://bugs.launchpad.net/bugs/1655969
commit 015105b12183556771e111e93f5266851e7c5582 upstream.

Make sure to drop the references taken by of_parse_phandle() and
bus_find_device() before returning from am335x_get_phy_control().

Note that there is no guarantee that the devres-managed struct
phy_control will be valid for the lifetime of the sibling phy device
regardless of this change.

Fixes: 3bb869c8b3f1 ("usb: phy: Add AM335x PHY driver")
Acked-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/usb/phy/phy-am335x-control.c