From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-f193.google.com ([209.85.222.193]:45218 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbeHaEwc (ORCPT ); Fri, 31 Aug 2018 00:52:32 -0400 Subject: Re: [PATCH v2 6/9] net: bcmgenet: fix OF child-node lookup To: Johan Hovold , Rob Herring , Greg Kroah-Hartman Cc: Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, stable , "David S . Miller" References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-7-johan@kernel.org> From: Florian Fainelli Message-ID: <683bdf11-a662-d17e-8bc5-b3cfd238e463@gmail.com> Date: Thu, 30 Aug 2018 17:47:33 -0700 MIME-Version: 1.0 In-Reply-To: <20180827082153.22537-7-johan@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 08/27/2018 01:21 AM, Johan Hovold wrote: > Use the new of_get_compatible_child() helper to lookup the mdio child > node instead of using of_find_compatible_node(), which searches the > entire tree from a given start node and thus can return an unrelated > (i.e. non-child) 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 node of the device being probed). > > Fixes: aa09677cba42 ("net: bcmgenet: add MDIO routines") > Cc: stable # 3.15 > Cc: Florian Fainelli > Cc: David S. Miller > Signed-off-by: Johan Hovold Reviewed-by: Florian Fainelli -- Florian