Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3700164imu; Mon, 14 Jan 2019 07:35:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN4daQLDD3dk/R7aW7/QaI7FmLu8RRl54VuU8icIelLuT8HQ0hJZnLTSgiSTUmRE74FWk0iD X-Received: by 2002:a63:8ac4:: with SMTP id y187mr23409491pgd.446.1547480115033; Mon, 14 Jan 2019 07:35:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547480115; cv=none; d=google.com; s=arc-20160816; b=olIYObdiwRGP6dvWCfHMuduE0wq5TScM3l5VAkIrFsMfhBUt9VSioRorX4WGSJdp1/ oQ3aPrKKHKa7KswC6INjLhONF+fnxzqJL6fzqcH7Xga29of4zstJJGlQK56H2hQJ4idE Mrxf4Q90CqxopWpAa4iA/69fcVaza7d+0kkiyYRFLXW+Ws4+MNmNO1JHOAtkxkwdqgin mEVHd53eDll6/E0GgQbRvqMEvO9prcVgs5d3sWU1k5zJRvOgGwzIwQuFi8OX1+R2sspj 3Rg1Li4CRcKZE8gKjd+z8DCuBLJmljTZhcjaTGRxr89B82Prz6RjzAKYGHMXoVnpFZw1 pVsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject:dkim-signature; bh=+O05ljDB432NQtxALGl6ShYbAmOX/If9lvRTBq+ufOg=; b=HRTRJUFrVqmB8AOo4Frkia8Q3UJ9w1ffFbuqaq8sXMhmz3LmPinyVfyUGer/IJtnJ1 M4Xu9vbpnJzM/A3NlvefoG+d7OJF9x+eGYnvCkj/4JwueIlqerqffvBB3Ps8/ttqlAUg TxhuKO9zPCu8UA6Ccsd3l/+hGLva74pi1X3wJez9iFnUOB7NVc8lAzYiUzH/rSnwfBEH KDdWi43LM4rBS5KsEumQ9p20TSG8a88VWC1RtPZXWmtfURtXlOa7IJv5BYP5OE9OTB9V lQM2wmKf0yMmocv2jOw1x4ru0nDvBqfFtY/vPfT0nze9pUGI8dO7Lfv+Kaexls5YjQSg 45zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=13fgKkMU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 133si590193pfc.61.2019.01.14.07.34.58; Mon, 14 Jan 2019 07:35:15 -0800 (PST) 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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=13fgKkMU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbfANPdD (ORCPT + 99 others); Mon, 14 Jan 2019 10:33:03 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:34924 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbfANPdD (ORCPT ); Mon, 14 Jan 2019 10:33:03 -0500 Received: by mail-wm1-f67.google.com with SMTP id t200so9349511wmt.0 for ; Mon, 14 Jan 2019 07:33:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:openpgp:autocrypt:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+O05ljDB432NQtxALGl6ShYbAmOX/If9lvRTBq+ufOg=; b=13fgKkMUWKwnVVM3rT5uMzNRJNjRTp39N3lf7CQhFYc3jschziMZQBuwDRz4+x2PFo 6R2671mdo9MAMl1SpdCJ6q+/YPvifK9kL40OE56ud7s23M11xMm5g4yGWC4G0NJtcQeI PyUqC2D4k9xUIyi2DO5ShdqNLv1rwRKnKvmCq6ZXk9baCT/HYBkN0zfiUAPzQFdHFO3J qacArYjn6I7Cx9h7sipTQk1CmzUunvFqCbWmCVSb5qqG+qdFjwdOxPocxTPFju0pw2Ej sSDpwJdI7GfzGZ1Vah4qGqLNyvT8+0GBZdfL/8a2tyRGxNB5WI0CsyejQgI2ZkLeHSqc LaMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+O05ljDB432NQtxALGl6ShYbAmOX/If9lvRTBq+ufOg=; b=HfJJ7qN3Tfm++SrhVD0QySgyb2aN9/HTBLgOP7OVcnNHnK20qliZDaMJGPHqXYPCzJ ag5dcpVj8zmxLYZ3RfBQPRFtGKLJCUKp5yhBlXQr2CFRSBGpN99fIdkNynng755hkggh FCCKotGZTsC6cdbQTzbVvWwHIlM5OJlb1/QVm1mpzIktJU6toUIkFvKCB/Ltvuta7ZJS XqALAM5QnZqLKvgWT2Yt80aOqZc9qd16Iq15Yp1NNatV/dQJXQ8Fc8U7Hiw9BDC7PS9O Wd6czZYXp0qQxRyufa/KWA83kYo5fRLr9571CcrSZQrMZwAWVMlAbXtDiqRXWzeViiie kLTw== X-Gm-Message-State: AJcUukfzY9sFv3I358vsInKO9D/E1Sz0+8xjodhc4r6aAcyTtynBRhj0 7L/AuiEmQjYpgoyceF3MJsSUB42DxARTdg== X-Received: by 2002:a1c:87cc:: with SMTP id j195mr12046394wmd.2.1547479979455; Mon, 14 Jan 2019 07:32:59 -0800 (PST) Received: from [10.1.2.12] (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.gmail.com with ESMTPSA id p4sm59237075wrs.74.2019.01.14.07.32.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 07:32:58 -0800 (PST) Subject: Re: [PATCH 3/3] drm/meson: add missing of_node_put To: Julia Lawall Cc: kernel-janitors@vger.kernel.org, David Airlie , Daniel Vetter , Kevin Hilman , dri-devel@lists.freedesktop.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <1547372691-28324-1-git-send-email-Julia.Lawall@lip6.fr> <1547372691-28324-4-git-send-email-Julia.Lawall@lip6.fr> From: Neil Armstrong Openpgp: preference=signencrypt Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= mQENBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAG0KE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT6JATsEEwEKACUC GyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheABQJXDO2CAhkBAAoJEBaat7Gkz/iubGIH/iyk RqvgB62oKOFlgOTYCMkYpm2aAOZZLf6VKHKc7DoVwuUkjHfIRXdslbrxi4pk5VKU6ZP9AKsN NtMZntB8WrBTtkAZfZbTF7850uwd3eU5cN/7N1Q6g0JQih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+LdaNyNgaqzMOtt4HYk86LYLSHfFXywdlbGrY9+TqiJ+ZVW4trmui NIJCOku8SYansq34QzYM0x3UFRwff+45zNBEVzctSnremg1mVgrzOfXU8rt+4N1b2MxorPF8 619aCwVP7U16qNSBaqiAJr4e5SNEnoAq18+1Gp8QsFG0ARY8xp+qaKBByWES7lRi3QbqAKZf yOHS6gmYo9gBmuAhc65/VtHMJtxwjpUeN4Bcs9HUpDMDVHdfeRa73wM+wY5potfQ5zkSp0Jp bxnv/cRBH6+c43stTffprd//4Hgz+nJcCgZKtCYIAPkUxABC85ID2CidzbraErVACmRoizhT KR2OiqSLW2x4xdmSiFNcIWkWJB6Qdri0Fzs2dHe8etD1HYaht1ZhZ810s7QOL7JwypO8dscN KTEkyoTGn6cWj0CX+PeP4xp8AR8ot4d0BhtUY34UPzjE1/xyrQFAdnLd0PP4wXxdIUuRs0+n WLY9Aou/vC1LAdlaGsoTVzJ2gX4fkKQIWhX0WVk41BSFeDKQ3RQ2pnuzwedLO94Bf6X0G48O VsbXrP9BZ6snXyHfebPnno/te5XRqZTL9aJOytB/1iUna+1MAwBxGFPvqeEUUyT+gx1l3Acl ZaTUOEkgIor5losDrePdPgE= Organization: Baylibre Message-ID: <30e505cf-fdfa-b546-c75d-5eb23366f7bb@baylibre.com> Date: Mon, 14 Jan 2019 16:32:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1547372691-28324-4-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Julia, On 13/01/2019 10:44, Julia Lawall wrote: > Add an of_node_put when the result of of_graph_get_remote_port_parent is > not available. > > An of_node_put is also needed when meson_probe_remote completes. This was > present at the recursive call, but not in the call from meson_drv_probe. > > The semantic match that finds this problem is as follows > (http://coccinelle.lip6.fr): > > // > @r exists@ > local idexpression e; > expression x; > @@ > e = of_graph_get_remote_port_parent(...); > ... when != x = e > when != true e == NULL > when != of_node_put(e) > when != of_fwnode_handle(e) > ( > return e; > | > *return ...; > ) > // > > Signed-off-by: Julia Lawall Acked-by: Neil Armstrong And applied to drm-misc-fixes. Neil > > --- > drivers/gpu/drm/meson/meson_drv.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c > index 3ee4d4a4e..b59c757 100644 > --- a/drivers/gpu/drm/meson/meson_drv.c > +++ b/drivers/gpu/drm/meson/meson_drv.c > @@ -388,8 +388,10 @@ static int meson_probe_remote(struct platform_device *pdev, > remote_node = of_graph_get_remote_port_parent(ep); > if (!remote_node || > remote_node == parent || /* Ignore parent endpoint */ > - !of_device_is_available(remote_node)) > + !of_device_is_available(remote_node)) { > + of_node_put(remote_node); > continue; > + } > > count += meson_probe_remote(pdev, match, remote, remote_node); > > @@ -408,10 +410,13 @@ static int meson_drv_probe(struct platform_device *pdev) > > for_each_endpoint_of_node(np, ep) { > remote = of_graph_get_remote_port_parent(ep); > - if (!remote || !of_device_is_available(remote)) > + if (!remote || !of_device_is_available(remote)) { > + of_node_put(remote); > continue; > + } > > count += meson_probe_remote(pdev, &match, np, remote); > + of_node_put(remote); > } > > if (count && !match) >