Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3773164imu; Mon, 14 Jan 2019 08:47:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN6wSxyS8LqzSXxsBEMu3pE3lXbb85KX4H6dQ90ydNe7pOPdUYGTkP2Q0lmJCwbAPhYXIal8 X-Received: by 2002:a62:c42:: with SMTP id u63mr25823830pfi.73.1547484459628; Mon, 14 Jan 2019 08:47:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484459; cv=none; d=google.com; s=arc-20160816; b=YiISJm38ktuSjnqMAMzIGJq92panNF8tZ8TvVCnKeENZtRE5saNtTxUccV/fJojD3U Sdf9J3jBYUeBdvhJgkE32Mhm7HjoIw3VlZ/uX8pAeR9LfL87MpOfIRZekAiIhmo4aGQL ciaM4JCXr9g64wO0LY2LBQPZyZkVIGMWyWMYoEkxdcSUinEh0Fyg85z5Nbm1y3JMjQ1U hfNXW5cOCRoF6+2fNOZAqCfgUf+6oaUjDngsNmkGzhmsQBRtkdB6/vdYVxa3TDbLC1l5 SyHEmaK6sSTd0Bl1rWxE10S7/hOqK6lz5ZOuW/yZrysL06NfBMrHcRPAOjk6T5ZfW+CS fBmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date; bh=6rb4bLLCOEzoS7l7F8BXYYmeJDWmfxueiFNT9QtteO8=; b=wzw9X6Q6X3E4cdX17so9J8iQP9R/UVFftb8ZpLyypyMWcPhUxOFxs4nJsD4e7vIUot ZHrSz2CHsypclFvHPU1tD+IIvnFrWQ3FAIu/a8MDCwhE+7qQxb+lVGqVLxj+qzkW4sL9 lfwBDEt4GJBZ9qF0w3H+XTo0/XRQ4TNd9EeXMJU/HK4NSyFhclJc4Lp+e8XOMh80xZ40 conDRsF2RynBQwTADuvg6N9gRTKcrfIQ+P4dl1o+f3O+k+pLo6lf1UdWcmZ3iV21Wz8I AklpDWPQMZrOhTDhooKs+8bY5gPpv9JhvgDu19+z/FnshqkUsSJrkY4IS1gDJnx+1Ylc JZXw== 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 q26si710997pgk.162.2019.01.14.08.47.23; Mon, 14 Jan 2019 08:47:39 -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 S1726956AbfANQpC (ORCPT + 99 others); Mon, 14 Jan 2019 11:45:02 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:37227 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbfANQpB (ORCPT ); Mon, 14 Jan 2019 11:45:01 -0500 X-IronPort-AV: E=Sophos;i="5.56,478,1539640800"; d="scan'208";a="291885649" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 17:44:58 +0100 Date: Mon, 14 Jan 2019 17:44:56 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Kieran Bingham cc: Laurent Pinchart , kernel-janitors@vger.kernel.org, David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3 v2] drm: rcar-du: add missing of_node_put Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 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 Add an of_node_put when the result of of_graph_get_remote_port_parent is not available. Add a second of_node_put if no encoder is selected (encoder remains NULL). The semantic match that finds the first 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 --- v2: Add the second of_node_put(entity);, as suggested by Kieran Bingham. drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index 9c7007d..f9a90ff 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -331,6 +331,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, dev_dbg(rcdu->dev, "connected entity %pOF is disabled, skipping\n", entity); + of_node_put(entity); return -ENODEV; } @@ -366,6 +367,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, dev_warn(rcdu->dev, "no encoder found for endpoint %pOF, skipping\n", ep->local_node); + of_node_put(entity); return -ENODEV; }