Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4053814imu; Mon, 14 Jan 2019 14:04:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7e3mxHxYDjO8KjzdtAA7hvfjZiCwSr0c4QnxBi1dq0k3lrXZ66EZKfsZcYZLo/0JqHGu66 X-Received: by 2002:a63:fe0a:: with SMTP id p10mr606789pgh.265.1547503469856; Mon, 14 Jan 2019 14:04:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547503469; cv=none; d=google.com; s=arc-20160816; b=fEAxXqs4yaOr0EYjm5DfRYdEl6H3V4A8uISrk57+y7VO9lSZGtAun9PUQBWW5jaxhU CbX+PeTZQDOY0n+2Voiisq70TmvbfrRVVp7NN9y8tPxauiTd4k0wuRIRfFI1JzM2ywB6 1xGCsXuV77ERAevfHbgti9fEpzQXCzXWgT5nw7/znupXv9tNw/c6QF4/SEtktkDvAi+/ KMudAm21nQw79lZ7ZQ/WrCc0JSV8a9BPiTI8CeVT5+K7JO8yY+2I+0WoyXQcB2zACDwV csCTdShLxdyzGb+dhM617hq5sAKxMlhSyhI+THTYA+8AYBWb/V1DXwWh8YlK34eSVWUG x35Q== 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:from:references:cc:to:subject:reply-to :dkim-signature; bh=E7dmrJg8PoTptsbgI9rBBvOUstzPGeTtcRJBhUiQvQE=; b=hO/hJ/jNpFfOQ7GG4RGwBonFIWYGv0WX/UJp3xlr2RP6Vxvdh/9rKe50j6KX7r0mNK oprdx29FnWiX/0ySkWI6eKX+0N5ymBzvHIl2rQtlQk3uQEeAwdBYyOwy0TjW/DiK1P9w Egm/BdtkTE0iOeiNV4QehF903ORw9bdWtyTYaYZwNmFu4pt790KfiW0uc1lj/3Y9TPTC Bt7sTIbP4Tep35sz3JAwXlKZpnGzQHAzbbvXT4M4fvRgd7lNwPQxzRleAtbJrn+PFLiR sjgpHE6R1nHgTWZxLUHj5jR9u7bcrQb42b2/3tfXSb8skqmecWj7u+sAYwu2JnNGcHun +gVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=evzm6hh6; 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 61si1363989plz.117.2019.01.14.14.04.13; Mon, 14 Jan 2019 14:04:29 -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 (test mode) header.i=@ideasonboard.com header.s=mail header.b=evzm6hh6; 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 S1727081AbfANWBb (ORCPT + 99 others); Mon, 14 Jan 2019 17:01:31 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:58626 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726646AbfANWBb (ORCPT ); Mon, 14 Jan 2019 17:01:31 -0500 Received: from [192.168.0.21] (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3B87A530; Mon, 14 Jan 2019 23:01:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547503288; bh=9TMMwkd3VuWBrwETYkOZnVdU8DkQmY7nw0beCVasr3k=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=evzm6hh6eikfecFbR63EOmuo9EjsAI63SgJdDdUv1CAAk7jEQdMnzFjtLRb/WrNhg H9OJSdBSAXJBuLA1mzx+RA390rZ1fuVfsC+JU9iB84qYmtySefdeIBLKNnAKGQWcL3 upovEHBCI0I7/NcXUUwHru3MwZelFoWnIdqh28GI= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH 1/3 v2] drm: rcar-du: add missing of_node_put To: Julia Lawall 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 References: From: Kieran Bingham Organization: Ideas on Board Message-ID: Date: Mon, 14 Jan 2019 22:01:24 +0000 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: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB 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 14/01/2019 16:44, Julia Lawall wrote: > 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 Thankyou for the update. Reviewed-by: Kieran Bingham > > --- > 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; > } >