Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3638540imu; Mon, 14 Jan 2019 06:35:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN6fCyqcghY2wJ21kYI4EhmeH5/v94lpCEhqrm4Zbs0UtnOGAQqeTxvYQyJ9kZPN5CCc99EF X-Received: by 2002:a63:2744:: with SMTP id n65mr22969237pgn.65.1547476536628; Mon, 14 Jan 2019 06:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547476536; cv=none; d=google.com; s=arc-20160816; b=zrt0iEP+fuwjSfVsQLEHBhngVfCbakLP92I4zBJhdTS/8E0KdbvkhjCRIe8CXqqvyj 6RFx07A5pBToe53HyG2Ik/OurXvilJ0YJ9XRalioNLp7LL+rBdQ7F0GAkLpSDjkZl6/T Jx9J3Fr/9cYkhTpSzOTiadTl/rUU6OcLM94vNU+X8f8RsPe56PlcBe9/qU95axZYFsEd 9FA7amLzVtxULQhy0MP/DTbX6b8c9q/lbRYKuU8sHHZ0o5FqnobSyFr39zcJZ85jGxjq xfcILQ5ubqTVNn/Smb6wMYQhgyJWGhCkP9onDYUim3K73uzqEFvPOfK4hn3YBVPpbSq6 /uKw== 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=Hw6RmT2WfrAd4lkbVt835uKgqYjWkYXwwEWoHxaWKnk=; b=07aT6BKpEUXgiKRiIYjI7OS/hUnL40psks1RH43erJszqNR+YJTZq2piVtsyIykfxf vlDUFDTEnrzmjKYzpfIDenVek3yH2UQs6wbOerT7G9MSB1c3q69PfOinZvvXnB6HUe4h 3BTx19YtHF9pWmxcCORouCPylqjLmM6osvogHV7EqkMg2SoHG//cKKCw0Hfq/c5sv0DB FDWSU9Ol00Dc2uAzQgMAv+wsTfuRN3Vh3hhgQQJjQO8+ZFuuikAXe6Y7KxO2iDZmIQls VlUVEgRB0pkbwNWKfS80ZQA+9tjutvdqu+t0bGAYUiBxfg9VcSupXYjqKfHuSZbvRQdh txEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="LM/Agwxv"; 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 h8si452231plr.343.2019.01.14.06.35.20; Mon, 14 Jan 2019 06:35:36 -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="LM/Agwxv"; 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 S1726584AbfANOeN (ORCPT + 99 others); Mon, 14 Jan 2019 09:34:13 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:48106 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbfANOeN (ORCPT ); Mon, 14 Jan 2019 09:34:13 -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 892CF530; Mon, 14 Jan 2019 15:34:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547476449; bh=OCDfCwN5LkQQQWkDE4WjP/f3ekZEjYyuyjzjinYRlEg=; h=Reply-To:Subject:To:Cc:References:From:Date:In-Reply-To:From; b=LM/AgwxvGnoe515B5u9vYRU+JMzRll57DohxILVE8g50SuHEJyB/FUTUKmpp61PVE g+8fiqMZ49LC2Q/l8g9CX6GEpPCIZ8W2Jz0pd9C3IlhSx5BElTFzRLAe6TE1c+j9Ds 3gDsuaS4OYm3dpm6ie/2JPrBNa57UA5tHKo1cqvg= Reply-To: kieran.bingham+renesas@ideasonboard.com Subject: Re: [PATCH 1/3] drm: rcar-du: add missing of_node_put To: Julia Lawall , Laurent Pinchart Cc: 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: <1547372691-28324-1-git-send-email-Julia.Lawall@lip6.fr> <1547372691-28324-2-git-send-email-Julia.Lawall@lip6.fr> From: Kieran Bingham Organization: Ideas on Board Message-ID: <78d7667d-f701-b908-9f24-0ee13be90947@ideasonboard.com> Date: Mon, 14 Jan 2019 14:34:06 +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: <1547372691-28324-2-git-send-email-Julia.Lawall@lip6.fr> 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, Thank you for the patch, On 13/01/2019 09:44, Julia Lawall wrote: > Add an of_node_put when the result of of_graph_get_remote_port_parent is > not available. > > The semantic match that finds this 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 ...; > ) > // > For this part at least: Reviewed-by: Kieran Bingham But a little discussion below: > Signed-off-by: Julia Lawall This does indeed look like a missing of_node_put() but I don't think it will be the only one in that code. It gets a bit tangled - and I think there's possibly another missing put on the error path of if (!encoder) { dev_warn(rcdu->dev, "no encoder found for endpoint %pOF, skipping\n", ep->local_node); return -ENODEV; } because that implies that no encoder was found, and thus - encoder = entity; was not executed, and the tail of that function calls: of_node_put(encoder); which would have been the final of_node_put(entity) I think that part could be considered separate to this patch, but it's also quite closely related. Either way - I think it needs a second pair of eyes to see if I'm not crazy :) Regards Kieran > > --- > drivers/gpu/drm/rcar-du/rcar_du_kms.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c > index 9c7007d..bc3fcb3 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; > } > >