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: 8117041 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 70FA29F818 for ; Tue, 26 Jan 2016 00:42:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA0F52034C for ; Tue, 26 Jan 2016 00:42:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CFE032035B for ; Tue, 26 Jan 2016 00:42:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932421AbcAZAmA (ORCPT ); Mon, 25 Jan 2016 19:42:00 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:36683 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbcAZAl6 (ORCPT ); Mon, 25 Jan 2016 19:41:58 -0500 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>; 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 Cc: Javier Martinez Canillas 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= Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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;