Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2553305imc; Sat, 23 Feb 2019 06:01:25 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib8ZhqiXfbxhJtzYBwisVtWDjRXE/FucLSsoiar7h1npHy5TFeTIEKE2vI242xHJwCSUaS7 X-Received: by 2002:a65:6099:: with SMTP id t25mr8875714pgu.448.1550930485385; Sat, 23 Feb 2019 06:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550930485; cv=none; d=google.com; s=arc-20160816; b=lVlhcOuawcecIgT/mPGSnLoI2DK7YrQEI4cE4+57EL4jzTK27Rky42/eFV6zUZGLJJ L599dt0lg8plWY8Czt8MdXQNe1xV7J1rqDwCZmylpgkw1kRyUHi3EiVlQjrGKJ3wANSD FVG6LruuxvLFIIEkZcPvxNKaHM3Z4dWdeB4dien9GotO2+S1yrz2gww7KHcx6Mp6VT3p KlfpmtngFy2UM1+zqkQBesVlTIka9+VJW+lbdKxVp6hVPh1flkpHyhswLwt8upOqxEqP HpRqdaRWc9iOJaChXswqe9ZrDUtp333zHvZ2Ls0phD/WkeiyQR5+zDGR6HR/1L82pTyx 83KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=24+HYUbHZU20tmnATNVPIrpuMS/7DoSKolI/Qo3Wfto=; b=piGzomnojbMCyiaN0F2zJnl+Tyl1JEn2Q1INr8ZnOcgF8D88n4cjhckQgDWcOJkH+H 1q8NZZNs4cw7e5ctet7WmuNBP8EVcAGIJbi489xIiKm+OIudPuYrvrxeK81378sz5Ldf EArR8rws/29UtM3GRVu7J1PT8/CR8yxACniNRGr+83sj0dpfM7qmh3oEahJlIn5M5cSJ Bp7Zp/VYssg1U/y1ppa5jZ7PgZg/GJKoVImliZTaS20b+nG72aep/g6Ks5f4F1HEu9cq zeFhwvJCvCzOGW+aZhDFAS4VXfW0MdaOO5YTAAx2hby7BistRC5JBlUyqU5/0gQv+xDn HkSw== ARC-Authentication-Results: i=1; mx.google.com; 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 1si4137118plh.125.2019.02.23.06.01.10; Sat, 23 Feb 2019 06:01:25 -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; 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 S1728121AbfBWN7S (ORCPT + 99 others); Sat, 23 Feb 2019 08:59:18 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:17528 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbfBWN6x (ORCPT ); Sat, 23 Feb 2019 08:58:53 -0500 X-IronPort-AV: E=Sophos;i="5.58,403,1544482800"; d="scan'208";a="370609510" Received: from palace.lip6.fr ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 23 Feb 2019 14:58:44 +0100 From: Julia Lawall To: Tony Lindgren Cc: kernel-janitors@vger.kernel.org, Russell King , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/12] ARM: OMAP2+: add missing of_node_put after of_device_is_available Date: Sat, 23 Feb 2019 14:20:42 +0100 Message-Id: <1550928043-14889-12-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add an of_node_put when a tested device node is not available. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ identifier f; local idexpression e; expression x; @@ e = f(...); ... when != of_node_put(e) when != x = e when != e = x when any if (<+...of_device_is_available(e)...+>) { ... when != of_node_put(e) ( return e; | + of_node_put(e); return ...; ) } // Fixes: e0c827aca0730 ("drm/omap: Populate DSS children in omapdss driver") Signed-off-by: Julia Lawall --- arch/arm/mach-omap2/display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -u -p a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -250,8 +250,10 @@ static int __init omapdss_init_of(void) if (!node) return 0; - if (!of_device_is_available(node)) + if (!of_device_is_available(node)) { + of_node_put(node); return 0; + } pdev = of_find_device_by_node(node);