Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6809750imm; Tue, 28 Aug 2018 01:08:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZRSnS9Pt9OimTqD5RgNxPXn65AXVKlCB1QlNYqzGYOeXs4bU/2ZXuslyrA5G3uAHgkeS2D X-Received: by 2002:a17:902:2e01:: with SMTP id q1-v6mr486332plb.40.1535443708430; Tue, 28 Aug 2018 01:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535443708; cv=none; d=google.com; s=arc-20160816; b=TejSk1nbt5Eg9CXM7FKdw6Wp2q6+LuIcIWtQ0mhIOpfs2KRPiThpkOLr68ZeSCJaI8 7enH/wDtsYinOzPztZS4GsqLecZxgXM8L1CMGo7oroHHHvTUYlEv1FDdfwg1WArNNxjI 0H5m+EMdRgYSBS1onONa5cL8KPLUpEnDFfyN52gd6XVmeMN5ks87F0m+9PYBcKg1pHTS XaSHCpgFGYgmAkvqIJ8mk9Xrc2IWcv1UkGH5x+R0GxhmtPMijE3onZ1KmeS76J4tNUtL gPhEKGdxqPs9oKno2ofu6eprE+Z1WrcJM5CyeH+BKICaGhGO7k7r0Fq4ZEczytdHevv1 Xk+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ibpJo3mS9ZCqy6elOIKakRAx623820KtQe0/ak395EM=; b=rQvVmbsKvfmrUo8lCs9O5hHBRg+unENVVRwVMu/h6H0PdXxsAnsJelOQAc8OQAnLbM 4aWPMISeIeSMX8+E92EacR6g0cTfGPOWIeSZ9nC1S8EgFNxCLI/VPOc73uMmU0QpBttP NScPUnk8/1jEdAMR8RQTVYGazLPKE7PB1o2ElcbV6G5QNerfQKsKmuYzCI/Sdy4lgEq+ YPOma7m6KmqGSyHOz9sEL7bC2uS53rdmOK86ifAQtfxHZ+RKWWcG5ub2yqrRhzfejuBq 1mqwEwjrVUer+7lP5N6rOoYXvv1a88Tp5z7CVCPBfhEaYO/AWIPUQYqKHzeiWOjHjATD HURw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SjESO+eq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t21-v6si442489plj.261.2018.08.28.01.08.12; Tue, 28 Aug 2018 01:08:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SjESO+eq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727308AbeH1L44 (ORCPT + 99 others); Tue, 28 Aug 2018 07:56:56 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38769 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726978AbeH1L44 (ORCPT ); Tue, 28 Aug 2018 07:56:56 -0400 Received: by mail-wr1-f68.google.com with SMTP id w11-v6so640624wrc.5; Tue, 28 Aug 2018 01:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ibpJo3mS9ZCqy6elOIKakRAx623820KtQe0/ak395EM=; b=SjESO+eqLuswBePoNUqLu41BUounh+NqpLVYcrCNQawipFJaxL+Qezic8FYQzZIQ2/ 0MXGjWpQMYxoRD7tbSSs2xBEQqGlUU58ufspgvShB2hfkkB1iDhQX8DSMXKtTa76J9fI 3KHHXYmZQoeDsE9FttUMI+0BNCzLdZmaM7j2InP181hBlVXPqKGjTvKo6VYxL5nuWhoZ 9jbcEARWfHPMKwSVIapOeTI9GGFLeqJtTB0FlOGZGaJ3ei/U3ZQyZ2QcEbaa4hgAQd+0 UY4sm0m2wpqGmEQgRywpWHPpNeJ/ZROXH1yl9odZtOKLzIyO2WmsjmrmTxmsC4WJXbyC 0fxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ibpJo3mS9ZCqy6elOIKakRAx623820KtQe0/ak395EM=; b=FHloBk7p2SnYCH0ZTVnj94m10LBwv6gm06zcZ/vh+Ca7Ql7Il5yoZOTlgC6poHN1Oo OQtFvVMhDMCtcrf9zdQ8UiEZCJPxdU1uq0aWu4iotvbceeCsUHmrJXjtRUB+JDzGTmnU /a7CcwRLss3LpJon8VO1tHvfqeOS3ecZSgOi0krd/7sjJznlD7twmWOgQTp9StfXkXvt 2OjZ5EATujmyLjvKiv+nHD2eADpMdIirjMQtP1YNZdTX9DEpTTw6I2IE6ENIBrXNZKgA ao0yFKn6K8EUbR14L2lTfl2fVfQS774tJnpe1BOz613NVt4VA6JHLLge4baLQRfOdxDU oCbA== X-Gm-Message-State: APzg51BeYjGlPH3PkqkJNrY/CXjQdTVZeOJwr49Y3w+d2aaCc0BBDgWX WcpRdN7YRCarlasyWGc9eCI= X-Received: by 2002:a5d:4401:: with SMTP id z1-v6mr329117wrq.227.1535443587907; Tue, 28 Aug 2018 01:06:27 -0700 (PDT) Received: from Red ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id z184-v6sm1689677wmz.0.2018.08.28.01.06.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 01:06:27 -0700 (PDT) Date: Tue, 28 Aug 2018 10:06:24 +0200 From: Corentin Labbe To: Johan Hovold Cc: Rob Herring , Greg Kroah-Hartman , Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , maxime.ripard@bootlin.com, wens@csie.org Subject: Re: [PATCH v2 7/9] net: stmmac: dwmac-sun8i: fix OF child-node lookup Message-ID: <20180828080624.GA25644@Red> References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-8-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180827082153.22537-8-johan@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 27, 2018 at 10:21:51AM +0200, Johan Hovold wrote: > Use the new of_get_compatible_child() helper to lookup the mdio-internal > 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 mdio-mux node). Fortunately, this was inadvertently > balanced by a failure to drop the mdio-mux reference after lookup. > > While at it, also fix the related mdio-internal- and phy-node reference > leaks. > > Fixes: 634db83b8265 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs") > Cc: Corentin Labbe > Cc: Andrew Lunn > Cc: Giuseppe Cavallaro > Cc: Alexandre Torgue > Cc: Jose Abreu > Cc: David S. Miller > Signed-off-by: Johan Hovold You should have CCed sunxi maintainers Maxime Ripard (maintainer:ARM/Allwinner sunXi SoC support) Chen-Yu Tsai (maintainer:ARM/Allwinner sunXi SoC support) Since I am just back from holidays, I will test this patch this week. Regards