Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp333521imm; Wed, 29 Aug 2018 00:56:29 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda0ow8Xh0zpKt4z7KJophi+hwPq1SURLm37lUbV0NOKDNwmH0Mky7iOU+5TVaAq+WrUI+5Z X-Received: by 2002:a62:2983:: with SMTP id p125-v6mr4805361pfp.128.1535529389515; Wed, 29 Aug 2018 00:56:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535529389; cv=none; d=google.com; s=arc-20160816; b=Ks0mnylqos3NSXlm7FucS6bqfDYl/B5ozxVXr7/P6PtGFw+VrI00lbBd6HrcL7IQy/ ty61fJwu5N5cLvx6Z05WEibBqOLawgllmPdnC73CGTCcQjfqUXVju4s1bkv7ijEWCuXZ E2VUna1QbXv5JYOmQiHhEGwNkOEJL2Uc8cBPGFNaBJ6RZz4VVh5dW+OS1nBT93aCUDCl PhZqh4Dr5bCXwYgLiLc/EnVzcaIj1O67oYj+Ido+Mw5s4cgSlBUzcXq0zNoyen1l9ebL aCbsuDjVvGJ6duIzFyyOBe03i9kxmNs86jqxwO6Kd1d3EGPnwlFO2LHErtZX/4+76e6a 9scg== 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=exfC6yQvuC0XyuOW1k1cLm7trC1MtDmQCj+JF/9GGLE=; b=pyn6UG3LQUIdOlQBgnkVy6WE3mRkWajhEpErDcrU1c09OEXDoDvczGuU0sYCMz6CQ8 UpuMknDm3qfPEULUTdW0zbGn8oyLGmr3ke1cEzcawywNriQ6doh5ZVoeZ4HBnVVAmQVY +LHEJfCp+e1pq/gZBcdGipHWoV78mtfhd5KIAuC3FP/Chva/BnD6+MtAHMXqISzPAwG1 hAY/Hm+g1yaDGLUZaUQalRTo/v67Y/Cm0rlUmoJFB8bDlHjqS55w+PqPimcLAvQDIwm4 QvUjLwq86bZpTtC9KWs8HD+VEfqljYQTqbYL3fJrmUonm6W9xgszBZkSDE7YrlECi7VB tooA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=JeWDemmt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p33-v6si3265540pld.151.2018.08.29.00.56.14; Wed, 29 Aug 2018 00:56:29 -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=fail header.i=@gmail.com header.s=20161025 header.b=JeWDemmt; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727616AbeH2LuJ (ORCPT + 99 others); Wed, 29 Aug 2018 07:50:09 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:41402 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727054AbeH2LuI (ORCPT ); Wed, 29 Aug 2018 07:50:08 -0400 Received: by mail-lf1-f68.google.com with SMTP id l26-v6so3498347lfc.8; Wed, 29 Aug 2018 00:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=exfC6yQvuC0XyuOW1k1cLm7trC1MtDmQCj+JF/9GGLE=; b=JeWDemmtdN1FfReIf8UalPHI3cwb30l0asn6nrUBrUWoEZMl5EGyz0NSwCXFBn09vC YRrphy9uKJwvwwe7fnnBH2HHJOjyMHC2WmMB+nPUL2GGEw2JT2ZLAtuCbaY53bmdV5J9 js8vQhsVXNpk/jB6UJ2MylyEfcDmiitxEmc6LpUWLZ0osRbgnFlR5DxWKqOVFJubwD1/ iBNWVgwC8EDe/lXB1H23njIALHK03UnZJiNieJOEQqxuRMdCHTZ2n1My3ylCDQKmxNGg S2EEZkrzsmbFXi1MOo93ucyY1orCwUg3D4Vt1VFxSLiHYwCrj2Ad+Dd09VHeOUSe+ZCK p0YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=exfC6yQvuC0XyuOW1k1cLm7trC1MtDmQCj+JF/9GGLE=; b=JtpwGgmjZLO8sVBxKPCl6aJveC2wGVarpsjYsDX8opFrNOeRYWJvhQ+gXczafx8AC7 eHyW7qqTdi2HKerP2MQ0JrkOEsG04tCBuFVT+AvXwr4C5uxIN1G8s9GsHWnhji/3LHPL +wOFBgrvmSbjtQihFMxm5UXZ58/KRJ0rzJVp3psrUVozwT5qOLw6f5j9ov8sWx6K9XhV +proUPOFhAUfQnZhvmAbPsSUMS3J4Ga+n+5JdYMU9b8hBtkKrqhsJl5ourEiUKUUKlp2 sYrsGu4H9x2TXmFc6PZDgqIl6GjcGGq+PmisJKU/jcfEi/DlNcED3mEUKjfaNQDhZAEm pOOg== X-Gm-Message-State: APzg51BYrmuMSvSE+9IAxPbMJKJi/qka9hhHZLlwqopLZDFLompqpsCK FIZEStXWsHHuT3nT4TLbG4g= X-Received: by 2002:a19:1ac8:: with SMTP id a191-v6mr3405756lfa.54.1535529270235; Wed, 29 Aug 2018 00:54:30 -0700 (PDT) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id n23-v6sm572480ljh.77.2018.08.29.00.54.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Aug 2018 00:54:29 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1fuvJ7-0007a2-La; Wed, 29 Aug 2018 09:54:29 +0200 Date: Wed, 29 Aug 2018 09:54:29 +0200 From: Johan Hovold To: Corentin Labbe Cc: Johan Hovold , 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: <20180829075429.GD28861@localhost> References: <20180827082153.22537-1-johan@kernel.org> <20180827082153.22537-8-johan@kernel.org> <20180828080624.GA25644@Red> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180828080624.GA25644@Red> 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 Tue, Aug 28, 2018 at 10:06:24AM +0200, Corentin Labbe wrote: > 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) Yeah, I cut down the CC list somewhat (I think because they didn't seem to be actively involved in the stmmac patch handling). Thanks for adding them back. > Since I am just back from holidays, I will test this patch this week. Thanks, that would be great. Johan