Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5646704img; Wed, 27 Mar 2019 12:22:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLdr0ZxSa33kFg98DUz7TK8qlMJRtnqIQz9/Q2GqBTStx+vE0jwYOykeFGEh4WQAGEYA9s X-Received: by 2002:a63:1749:: with SMTP id 9mr34774373pgx.94.1553714535219; Wed, 27 Mar 2019 12:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714535; cv=none; d=google.com; s=arc-20160816; b=OclLR8kjDMvzItbfMVlHvgARcYko5JsOSxuVLT0geFkj0jmzQ7PsuWT7QybV6lmc/k nFX7UvocvFI2SKJFEC/OIBgvNB2BBD4UriN7Mp3DoZA889WFBbDPR7b/n1gAOr8mxgaP X1C6QwVmAbgYXnUzpgLSHDQaXG9VbaV5UBgD/acgeXXEFs3oJ0zD0sa2Vv6cq67aIwcz kcH34CIDlMX/d53fgMcWDPZe2dyA4kFW4hOSNV1qmioBUESwgZqQ1mVd7FE6WIb5PUPr UelkVTMGw19lo7gxtctNNWNQrauauwBRdC85TCqDUxxMDinL5igzWMoYksOIUE8xgqTf OC4A== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=uf9J0U0OXIesiNDwZJClI2PGv2iOLhbdsKQ3eSGI/qg=; b=gQ3fRjSw9i0kRRCCRgGOVSwVNwzfiXcR5/p0lL0BfwIfHokaD/Mtd061mg5fwK5zCL EdH/iVWMgY4+izAlWb+CVcnGxAlMF2RCzFeTDMU04N5ChFSembp6cpUfbJwRFQ4hUi29 M9ewLl+zBBo1SUkppFDVlnJWVW7rujJq+oAsi94OgVJLqSehGsPwyvn0PwKqhp6tGcmR Mf5ITtA5pxbosbWNgRCzeVBD/b+KlYnbuIjUQVYY1dgSxxCljbLdjulD9RqIG1vyq4e/ Sau8wP1sWPteAcEGnXS/JW+F0fsS9Vdd5igDDQUQqt4EjeuChFmDIcmYF7c56MdZHWg7 eZ8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k2Or5qKN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v18si18443904pfm.241.2019.03.27.12.22.00; Wed, 27 Mar 2019 12:22:15 -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=k2Or5qKN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388168AbfC0SHZ (ORCPT + 99 others); Wed, 27 Mar 2019 14:07:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:49190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388160AbfC0SHV (ORCPT ); Wed, 27 Mar 2019 14:07:21 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4232A21738; Wed, 27 Mar 2019 18:07:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710041; bh=xqc6ISLkolKtaTmo5FoEEfKK/L9IDmdMKsnen2DqFkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k2Or5qKNN/12ORTT3bMIeyRdmrhF9GyjLsZDvCw4WLtmKUmGbawpRyWrsnmfgUSA/ 3e9GAoHeEMUj2SV6auY8jPi8zHwSWAfwJJoRX86bEgCq9WTcTOYna8VIRnH/Ca8cie AuSwaiiELgz7scl0bfKIvkgLonyUTqtr7kQv9N6k= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Julia Lawall , Julia Lawall , Laurent Pinchart , Sasha Levin , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 170/262] drm: rcar-du: add missing of_node_put Date: Wed, 27 Mar 2019 14:00:25 -0400 Message-Id: <20190327180158.10245-170-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julia Lawall [ 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 9c7007d45408..f9a90ff24e6d 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; } -- 2.19.1