Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3858228imu; Mon, 14 Jan 2019 10:14:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN6LO9VaCfOXKDfS8B4YUjelXVCCkB2Y17lkwS/biB9n7DJNycKJbOXvWKvAeXlGh0vZlHdV X-Received: by 2002:a62:6ec8:: with SMTP id j191mr26629051pfc.198.1547489668679; Mon, 14 Jan 2019 10:14:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547489668; cv=none; d=google.com; s=arc-20160816; b=u/4azsRaSBsff4Xgyqwd2Wmqy9ScPU93LGn1ESCwimnB9c9D9Vgtuej7ASL8o5uBp3 HdZJ7G4n8hXNuNaoARcZh6jPfgHCm6WrdlKuclq1d8jCP0lqG+Mii9vGKqlzSA3sRyGM /DJaqndlsvdzfptWMj+rOAabtz5iapHP3YDf7JdgG5rTBcAT2bPKl6ioU1LwBtJDAAX2 yhPDrQpZJqvIQnyc0zKUyPuGLSvNMl5zk/FRGq3zcZxwSMiAhitgp5WcHI27vCBDzjoZ t1nJUU+Gn2snX+Z8Hr896YiErRrogFPBiH8PDLNS/ILU+L7k2OUUTG90bb68LJ8rMC0U RVBw== 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 :references:in-reply-to:organization:message-id:date:subject:cc:to :from:dkim-signature; bh=KWaQdsHn7ThrIALb9QV2AELuia7YffX46mFSQBQPq3c=; b=s/veQ0uRUp2Mas7kYWWIu6frvk9EZWsx51FAJDKyw810SC5Xp0fw36DhuLMIX5/+9r dcWNcIkP13BD6D6pcVucwjKgfce03qeBtTlAneBl7EI/Z6dHith6u74cuztlH2347pEG 7zYLBTrzigzSYc2g9V3ZPU416Rvemks7gyObDjkZxqCUpBMV4BxB02DPmb6L2GuBLDVN kPfpjJZSK6reAvZFUZO16sETkKomgr60lDc1kdyYILUhp7nSdWWksYLMLfmz/bE77OzG XnN+NxYDgMmNp9WP4QK547JQFpNCRC2/MDI5F8taFPI38kJ840LjcPAmqsI4BFDHZ2Dt K8dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=dPrpA2YH; 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 m8si379364pls.400.2019.01.14.10.14.12; Mon, 14 Jan 2019 10:14:28 -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=dPrpA2YH; 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 S1726806AbfANSMp (ORCPT + 99 others); Mon, 14 Jan 2019 13:12:45 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:55048 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbfANSMp (ORCPT ); Mon, 14 Jan 2019 13:12:45 -0500 Received: from avalon.localnet (dfj612ybrt5fhg77mgycy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:2e86:4862:ef6a:2804]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 01ECB530; Mon, 14 Jan 2019 19:12:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547489562; bh=Po9QtX/5cAR5h7sBsCY/t3DG/3aqOXT9HbC4ic+ks34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPrpA2YH/5l0UxL5jggi2Sk3Sy5weEhVzvXdUr8xj4MaWoguTzrwmydsxSX781vN1 4DuJdslqrQUYtCWnb0JJ0Fx7YifVsGYKzSDiBpKuv9YGlf6krZm/Z17NT/JhZ1iYM1 3PDd3UNcSut38onXhhtG+lqbD1rz3bWvZ5WDnuHU= From: Laurent Pinchart To: Julia Lawall Cc: Kieran Bingham , 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: Re: [PATCH 1/3 v2] drm: rcar-du: add missing of_node_put Date: Mon, 14 Jan 2019 20:13:57 +0200 Message-ID: <10676089.h4Wfvzvksh@avalon> Organization: Ideas on Board Oy In-Reply-To: References: 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, Thank you for the patch. On Monday, 14 January 2019 18:44:56 EET 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 Reviewed-by: Laurent Pinchart and applied to my tree. > --- > 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; > } -- Regards, Laurent Pinchart