Johan Hovold 9844fb2e35 power: supply: twl4030-charger: fix OF sibling-node lookup
Use the new of_get_compatible_child() helper to lookup the usb sibling
node instead of using of_find_compatible_node(), which searches the
entire tree from a given start node and thus can return an unrelated
(non-sibling) node.

This also addresses a potential use-after-free (e.g. after probe
deferral) as the tree-wide helper drops a reference to its first
argument (i.e. the parent device node).

While at it, also fix the related phy-node reference leak.

Fixes: f5e4edb8c888 ("power: twl4030_charger: find associated phy by more reliable means.")
Cc: stable <stable@vger.kernel.org>     # 4.2
Cc: NeilBrown <neilb@suse.de>
Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Sebastian Reichel <sre@kernel.org>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
2018-10-23 13:28:53 -05:00
..
2018-08-25 18:13:10 -07:00
2018-08-27 14:25:54 -06:00
2018-08-30 13:39:04 -07:00
2018-08-20 16:30:27 -07:00
2018-08-23 13:52:46 -07:00
2018-08-25 18:43:59 -07:00
2018-08-08 15:44:47 +10:00
2018-08-20 15:38:44 -07:00
2018-10-23 13:20:04 -05:00
2018-08-23 15:34:48 -07:00
2018-08-23 13:44:43 -07:00
2018-08-16 12:26:24 -07:00
2018-08-25 18:13:10 -07:00
2018-08-23 13:52:46 -07:00
2018-07-30 10:04:58 +02:00
2018-08-20 15:38:44 -07:00
2018-08-22 14:14:15 -07:00
2018-08-18 11:04:51 -07:00
2018-08-20 11:36:07 +02:00
2018-08-20 15:38:44 -07:00
2018-08-25 14:12:36 -07:00
2018-08-20 16:30:27 -07:00
2018-08-25 18:13:10 -07:00
2018-08-18 16:45:27 -07:00
2018-08-23 13:52:46 -07:00
2018-08-23 13:52:46 -07:00
2018-08-24 09:34:23 -07:00
2018-08-19 09:30:44 -07:00
2018-08-23 13:52:46 -07:00
2018-08-17 11:32:50 -07:00
2018-08-24 08:45:19 -07:00
2018-08-31 08:45:16 -07:00
2018-08-18 11:04:51 -07:00