Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1024206yba; Thu, 4 Apr 2019 02:40:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/q2ayLHkngv15FOqTSzFIWEUOqm+V7rxWp7H46DM3p7t4isN30glBCQQwZVnad+Xuo64x X-Received: by 2002:a63:f444:: with SMTP id p4mr5007025pgk.32.1554370835443; Thu, 04 Apr 2019 02:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554370835; cv=none; d=google.com; s=arc-20160816; b=btatcmK+VrsE09OP0njVbn8A4pNIR059KaEPIVzjWRgHSF/hDKG1+TruSfhyKQxxa6 KGIr2tIrTzKY0xzRzukDJqFtnH7oBtA5bjbhSB172QemJ2dFa31nzG2MehALx2rdG9sv NqMtdOCTN5/wrPYV0L+ShAD6XnCSLQySj1xBs0X+W7uhtrXhmvGiMgy8K6U8CTIqRVdF xkHLTTkT4a4NuRICApm6mfggCGQ03vLZjuhNB3ecfekyteRsURWjvRDw0eXCezNitpfL 4cMobj7JhgUHd/kCX4N36SHG5XrViay/NeXHS8ZJPl36S+ahuVQJR0z/k2Wt0TY2L2iy hxxg== 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=zj57qWjfH3X4r3cucnLrIyM5JWdhWa8n5CPhk945hyU=; b=aDn3zDYaeL6M+IddI/KNsxsbp/0h+/Rr+Bg7Y2txU/4h2BfHfRx2SDPn6TPM6QtWD1 nH7GEN/MlrvL0BfWly2p5K8JQCC2Vcr4q/EzVYnXLMjZdbQwimhVpYA8nPNLVZ0fnf0O M5aNdfAJPtpqkHVmHehi1RoQUtupIzKYma0D2Si84x8m7+zKztzrnzWQoOmX2KrClhnM rxptz0u3RJMH/OIOEbQGHEWaEePs7MgWbjITwQvMzKZ+89rhml62/FUY9TVlQE3ipFsH lt5w/eT0o1griteSSMF3cFkNuSTVwpz1+ZjkgvdCUp1HQRfVppeB9mNJGPjxmqvLwvR5 af6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XGm4m81n; 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 v25si15941217pgo.317.2019.04.04.02.40.20; Thu, 04 Apr 2019 02:40:35 -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=XGm4m81n; 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 S1731952AbfDDJEV (ORCPT + 99 others); Thu, 4 Apr 2019 05:04:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:42098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731502AbfDDJEU (ORCPT ); Thu, 4 Apr 2019 05:04:20 -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 21BEC2147C; Thu, 4 Apr 2019 09:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554368659; bh=0Jud5Nh/Vdv45lDXuUCMCtmE07O1Wdz6ghktKJvGbeU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XGm4m81nao+Wod4RMNMLDY969ynirNb1C4/rBPyLWNlqxwMaE995Xv8UbyQHZHDrR W7U7YFYwk2456rlm20MUyuRZ7uG97C9o6Eg8F2mG3PnPFFCP6YIkh59eFPiZwcNjxJ NYV/hroZaghCaytjTamKhdOOPlocpKJ7xZ3wXk3I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Lawall , Laurent Pinchart , Kieran Bingham , Sasha Levin Subject: [PATCH 4.19 121/187] drm: rcar-du: add missing of_node_put Date: Thu, 4 Apr 2019 10:47:38 +0200 Message-Id: <20190404084608.942573298@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084603.119654039@linuxfoundation.org> References: <20190404084603.119654039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 4c6d8fc20b09f9684743afd72e4dbc3f15524479 ] 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 Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin --- 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 fb46df56f0c4..0386b454e221 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -300,6 +300,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; } @@ -335,6 +336,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; } -- 2.19.1