From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com ([209.85.208.196]:45023 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726573AbeHWLI5 (ORCPT ); Thu, 23 Aug 2018 07:08:57 -0400 Date: Thu, 23 Aug 2018 09:40:35 +0200 From: Johan Hovold To: Sebastian Reichel Cc: Johan Hovold , Rob Herring , Greg Kroah-Hartman , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, stable , NeilBrown , Felipe Balbi Subject: Re: [PATCH 9/9] power: supply: twl4030-charger: fix OF sibling-node lookup Message-ID: <20180823074035.GQ14967@localhost> References: <20180822105547.9634-1-johan@kernel.org> <20180822105547.9634-10-johan@kernel.org> <20180822213658.uuzsalnlxbayc4ml@earth.universe> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180822213658.uuzsalnlxbayc4ml@earth.universe> Sender: stable-owner@vger.kernel.org List-ID: On Wed, Aug 22, 2018 at 11:36:58PM +0200, Sebastian Reichel wrote: > Hi, > > On Wed, Aug 22, 2018 at 12:55:47PM +0200, Johan Hovold wrote: > > 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 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 # 4.2 > > Cc: NeilBrown > > Cc: Felipe Balbi > > Cc: Sebastian Reichel > > Signed-off-by: Johan Hovold > > --- > > Reviewed-by: Sebastian Reichel Thanks for reviewing. Johan