From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko =?ISO-8859-1?Q?St=FCbner?= Date: Sat, 16 Jun 2018 12:24:09 +0000 Subject: Re: [PATCH 5/5] drm/rockchip: lvds: add missing of_node_put Message-Id: <1948755.WvuARZiism@diego> List-Id: References: <1527102436-13447-1-git-send-email-Julia.Lawall@lip6.fr> <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Julia Lawall Cc: David Airlie , kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Hi Julia, Am Mittwoch, 23. Mai 2018, 21:07:16 CEST schrieb Julia Lawall: > The device node iterators perform an of_node_get on each iteration, so a > jump out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // > @@ > expression root,e; > local idexpression child; > iterator name for_each_child_of_node; > @@ > > for_each_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > + of_node_put(child); > ? break; > ... > } > ... when != child > // > > Signed-off-by: Julia Lawall thanks for catching this. I've added a "Fixes"-tag and applied the patch to drm-misc-next Thanks Heiko From mboxrd@z Thu Jan 1 00:00:00 1970 From: Heiko =?ISO-8859-1?Q?St=FCbner?= Subject: Re: [PATCH 5/5] drm/rockchip: lvds: add missing of_node_put Date: Sat, 16 Jun 2018 14:24:09 +0200 Message-ID: <1948755.WvuARZiism@diego> References: <1527102436-13447-1-git-send-email-Julia.Lawall@lip6.fr> <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Julia Lawall Cc: David Airlie , kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org List-Id: linux-rockchip.vger.kernel.org SGkgSnVsaWEsCgpBbSBNaXR0d29jaCwgMjMuIE1haSAyMDE4LCAyMTowNzoxNiBDRVNUIHNjaHJp ZWIgSnVsaWEgTGF3YWxsOgo+IFRoZSBkZXZpY2Ugbm9kZSBpdGVyYXRvcnMgcGVyZm9ybSBhbiBv Zl9ub2RlX2dldCBvbiBlYWNoIGl0ZXJhdGlvbiwgc28gYQo+IGp1bXAgb3V0IG9mIHRoZSBsb29w IHJlcXVpcmVzIGFuIG9mX25vZGVfcHV0Lgo+IAo+IFRoZSBzZW1hbnRpYyBwYXRjaCB0aGF0IGZp eGVzIHRoaXMgcHJvYmxlbSBpcyBhcyBmb2xsb3dzCj4gKGh0dHA6Ly9jb2NjaW5lbGxlLmxpcDYu ZnIpOgo+IAo+IC8vIDxzbXBsPgo+IEBACj4gZXhwcmVzc2lvbiByb290LGU7Cj4gbG9jYWwgaWRl eHByZXNzaW9uIGNoaWxkOwo+IGl0ZXJhdG9yIG5hbWUgZm9yX2VhY2hfY2hpbGRfb2Zfbm9kZTsK PiBAQAo+IAo+ICBmb3JfZWFjaF9jaGlsZF9vZl9ub2RlKHJvb3QsIGNoaWxkKSB7Cj4gICAgLi4u IHdoZW4gIT0gb2Zfbm9kZV9wdXQoY2hpbGQpCj4gICAgICAgIHdoZW4gIT0gZSA9IGNoaWxkCj4g KyAgb2Zfbm9kZV9wdXQoY2hpbGQpOwo+ID8gIGJyZWFrOwo+ICAgIC4uLgo+IH0KPiAuLi4gd2hl biAhPSBjaGlsZAo+IC8vIDwvc21wbD4KPiAKPiBTaWduZWQtb2ZmLWJ5OiBKdWxpYSBMYXdhbGwg PEp1bGlhLkxhd2FsbEBsaXA2LmZyPgoKdGhhbmtzIGZvciBjYXRjaGluZyB0aGlzLiBJJ3ZlIGFk ZGVkIGEgIkZpeGVzIi10YWcgYW5kCmFwcGxpZWQgdGhlIHBhdGNoIHRvIGRybS1taXNjLW5leHQg CgoKVGhhbmtzCkhlaWtvCgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX18KZHJpLWRldmVsIG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0 b3Aub3JnCmh0dHBzOi8vbGlzdHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJp LWRldmVsCg== From mboxrd@z Thu Jan 1 00:00:00 1970 From: heiko@sntech.de (Heiko =?ISO-8859-1?Q?St=FCbner?=) Date: Sat, 16 Jun 2018 14:24:09 +0200 Subject: [PATCH 5/5] drm/rockchip: lvds: add missing of_node_put In-Reply-To: <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> References: <1527102436-13447-1-git-send-email-Julia.Lawall@lip6.fr> <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> Message-ID: <1948755.WvuARZiism@diego> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Julia, Am Mittwoch, 23. Mai 2018, 21:07:16 CEST schrieb Julia Lawall: > The device node iterators perform an of_node_get on each iteration, so a > jump out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // > @@ > expression root,e; > local idexpression child; > iterator name for_each_child_of_node; > @@ > > for_each_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > + of_node_put(child); > ? break; > ... > } > ... when != child > // > > Signed-off-by: Julia Lawall thanks for catching this. I've added a "Fixes"-tag and applied the patch to drm-misc-next Thanks Heiko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14298C5CFC0 for ; Sat, 16 Jun 2018 12:24:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB351208AF for ; Sat, 16 Jun 2018 12:24:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB351208AF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932802AbeFPMYi (ORCPT ); Sat, 16 Jun 2018 08:24:38 -0400 Received: from gloria.sntech.de ([95.129.55.99]:48060 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932681AbeFPMYh (ORCPT ); Sat, 16 Jun 2018 08:24:37 -0400 Received: from ip5f5a8448.dynamic.kabel-deutschland.de ([95.90.132.72] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fUAFV-0006iW-V5; Sat, 16 Jun 2018 14:24:10 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Julia Lawall Cc: Sandy Huang , kernel-janitors@vger.kernel.org, David Airlie , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] drm/rockchip: lvds: add missing of_node_put Date: Sat, 16 Jun 2018 14:24:09 +0200 Message-ID: <1948755.WvuARZiism@diego> In-Reply-To: <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> References: <1527102436-13447-1-git-send-email-Julia.Lawall@lip6.fr> <1527102436-13447-6-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Julia, Am Mittwoch, 23. Mai 2018, 21:07:16 CEST schrieb Julia Lawall: > The device node iterators perform an of_node_get on each iteration, so a > jump out of the loop requires an of_node_put. > > The semantic patch that fixes this problem is as follows > (http://coccinelle.lip6.fr): > > // > @@ > expression root,e; > local idexpression child; > iterator name for_each_child_of_node; > @@ > > for_each_child_of_node(root, child) { > ... when != of_node_put(child) > when != e = child > + of_node_put(child); > ? break; > ... > } > ... when != child > // > > Signed-off-by: Julia Lawall thanks for catching this. I've added a "Fixes"-tag and applied the patch to drm-misc-next Thanks Heiko