Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2532708yba; Mon, 6 May 2019 07:36:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqypEf2V9GI6L5Lbamcn2jj84tnn5CEPCN2tE92wLClaUov8yNFxs11LbQZvYV7eongYzMto X-Received: by 2002:a63:1d02:: with SMTP id d2mr5765001pgd.26.1557153380549; Mon, 06 May 2019 07:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557153380; cv=none; d=google.com; s=arc-20160816; b=Aa2uU/gLAAx4Tx6B1cljRGVVIKeKrYY/UjzvzbZDGrhhFc0e/XetL4gXnebQFUo3pe G00QnXq3jerDoMmTdxbOkUINe5uLEWFVufF/ppg/5Y6UXJ0yCdho5aj5KHYmWnRl2GEq 7cxofyO2vHb2bICF4dKdk9QaWc9yhzTuD0NWJ9I2y5MMF6V9huLsb19IrJwHtpH8qi8Q 7cK+PqgUgtL9Dpnw0zHqT/IwG0dokpd6VEF7xPd2bvmjpiomQlGIEyP66YjUgiehg+si ASb8KIzO0+Ex8GnNqrD+x2lcV4jTkf9QoJ/4GZsrbzcBe7hrwv8rmznMMUQlJ8ISBLFV VswQ== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C6mOy+208XIbbZB0r6qKBtzi+QrA5/0yc/vfVj1aWXY=; b=kMtjjIn6Oz5/gTNUkKKr9RvnpAxaZdEhB43oIXPGDI7ZgrJHYDWZALY9Gm0zpe1jTj UwoTOHG5+owy/ywC8xxxI+iCb3hjVG8V0dNekeq5VI3byZ/2sp2Nvej9cLf0BFnD/TVv viSdHqEuXq5Lvh4ef7YthL6G8ktP9BYoR857kC9qTvwiFQUuzJUarKF885eomBsr1t7s tRpxA0AuGuQt5JbxJlpmAOmVnJgZx+lC8ih3M35wXoxWh7Rg77pijRQZaQJCOiCDyHj6 vUfOlAB4FaYLAuSjGFowCKDUWybg1tRii5Gx/8W6e0VsVh8KuEdMuWR8W922ANt7a88m hRXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fxvVkdM1; 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 o4si16193086plb.312.2019.05.06.07.36.04; Mon, 06 May 2019 07:36:20 -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=@kernel.org header.s=default header.b=fxvVkdM1; 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 S1726739AbfEFOep (ORCPT + 99 others); Mon, 6 May 2019 10:34:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:54492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfEFOen (ORCPT ); Mon, 6 May 2019 10:34:43 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1D50921019; Mon, 6 May 2019 14:34:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557153282; bh=DFszRYzucD78m3OF8MucKZz0JRnQTtcXGYMj7cOZpV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fxvVkdM1Pct2Cutm7uwJneT3mD3Zoek5PMXtRArLLw48/RWDcdIVdpDZEYpAONBga t36BtBzC3uxslHJ6rBIZxX9nAP97BKzxNbLDqxYLwuUEtc9zknjPabKwKNQ+8XADzR flqcDZZSpy55+Pb1+m7Smt5feKq2loAwPtQEvyCg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Lawall , Tony Lindgren , "Sasha Levin (Microsoft)" Subject: [PATCH 5.0 031/122] ARM: OMAP2+: add missing of_node_put after of_device_is_available Date: Mon, 6 May 2019 16:31:29 +0200 Message-Id: <20190506143057.589975291@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190506143054.670334917@linuxfoundation.org> References: <20190506143054.670334917@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 30645307e5d2c8a4caf978558c66121ac91ad17e ] 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 Signed-off-by: Tony Lindgren Signed-off-by: Sasha Levin (Microsoft) --- arch/arm/mach-omap2/display.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 1444b4b4bd9f..439e143cad7b 100644 --- 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); -- 2.20.1