From patchwork Tue Jan 26 00:41:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 8117111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C6CA9F818 for ; Tue, 26 Jan 2016 00:45:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F126A2013D for ; Tue, 26 Jan 2016 00:44:59 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ED972012B for ; Tue, 26 Jan 2016 00:44:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNriB-0000ju-VD; Tue, 26 Jan 2016 00:42:23 +0000 Received: from mailout2.w1.samsung.com ([210.118.77.12]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNri7-0000iM-Gk for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2016 00:42:21 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O1J00AJ5B9V5C00@mailout2.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2016 00:41:55 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-dc-56a6c0d39dd6 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id A8.9D.21385.3D0C6A65; Tue, 26 Jan 2016 00:41:55 +0000 (GMT) Received: from localhost.localdomain ([10.113.63.52]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O1J002XRB9O5800@eusync4.samsung.com>; Tue, 26 Jan 2016 00:41:55 +0000 (GMT) From: Krzysztof Kozlowski To: Kyungmin Park , Sylwester Nawrocki , Mauro Carvalho Chehab , Kukjin Kim , Krzysztof Kozlowski , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFT 1/2] [media] exynos4-is: Add missing endpoint of_node_put on error paths Date: Tue, 26 Jan 2016 09:41:45 +0900 Message-id: <1453768906-28979-1-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupgluLIzCtJLcpLzFFi42I5/e/4Nd3LB5aFGTzcoWjx5u0aJovXLwwt +h+/ZrY42/SG3WLT42usFpd3zWGz6NmwldVixvl9TBarn1VYHH7TzurA5bFpVSebx+Yl9R5b +u+ye/RtWcXo8XmTXABrFJdNSmpOZllqkb5dAlfGzi8LmAr2c1TMmPmdpYFxJnsXIyeHhICJ xOyXz9ggbDGJC/fWA9lcHEICSxklLk8/xgrh/GeUmDNzEQtIFZuAscTm5UvAqkQEnjNJLJo2 FWwUs4CpxOO768GKhAUiJC5/n8YKYrMIqEps3fgJqIGDg1fAXeLLxACIbXISJ49NZp3AyL2A kWEVo2hqaXJBcVJ6rpFecWJucWleul5yfu4mRkj4fN3BuPSY1SFGAQ5GJR5ezuJlYUKsiWXF lbmHGCU4mJVEePfuBQrxpiRWVqUW5ccXleakFh9ilOZgURLnnbnrfYiQQHpiSWp2ampBahFM lomDU6qBMX6eF49eo/06WRYfu5D3izj1NX9OCni35qHv17SHSkqz7Nz6frCoetWlGLZs61n9 Sn+x89WXmdeELggfYRR9bRHWU3TiLH9ezL2dJyKeSPsFP01RSJjQw22wYRmDh+4PlgfbTiXZ rvYrnWvmuH9aNhdHu23b33z5pztO5TTPTpqQ8DsmI3uVEktxRqKhFnNRcSIAGP2MzBsCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160125_164219_735100_CF501DDE X-CRM114-Status: GOOD ( 16.95 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Javier Martinez Canillas MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In fimc_md_parse_port_node() endpoint node is get with of_get_next_child() but it is not put on error path. Fixes: 56fa1a6a6a7d ("[media] s5p-fimc: Change the driver directory name to exynos4-is") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Javier Martinez Canillas --- Not tested on hardware, only built+static checkers. --- drivers/media/platform/exynos4-is/media-dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index f3b2dd30ec77..de0977479327 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -339,8 +339,10 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd, return 0; v4l2_of_parse_endpoint(ep, &endpoint); - if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS) + if (WARN_ON(endpoint.base.port == 0) || index >= FIMC_MAX_SENSORS) { + of_node_put(ep); return -EINVAL; + } pd->mux_id = (endpoint.base.port - 1) & 0x1;