From patchwork Thu Sep 8 15:48:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 9321703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84B9E6077F for ; Thu, 8 Sep 2016 15:54:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75D83298E8 for ; Thu, 8 Sep 2016 15:54:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A312298FA; Thu, 8 Sep 2016 15:54:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8729298E8 for ; Thu, 8 Sep 2016 15:54:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933133AbcIHPym (ORCPT ); Thu, 8 Sep 2016 11:54:42 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.163]:20229 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932299AbcIHPyl (ORCPT ); Thu, 8 Sep 2016 11:54:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1473350077; l=2973; s=domk; d=goldelico.com; h=Date:Subject:Cc:To:From; bh=/EX+zZ94HA94MhBcY81HEw/Ldn8ZlHgATnqoq0GIxIA=; b=SYdyyRMypw1Ols2Y5KB0cjyuHN3xrv1jSWpw2BbVk4Mbl2T+R3rmLCNYQsFdADFoDYa MD4jgy0tEOUO7m5RrUJFPMUEDcobefNKkx+NDZmgOjForMbWjmzWOrnrMgZac1lmRGVEz Pv20gJ6rDQTv8P9NGf0k5zvxS/mI8OCVfz4= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKIDgoJYT2 X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (p57AE0647.dip0.t-ipconnect.de [87.174.6.71]) by smtp.strato.de (RZmta 39.1 DYNA|AUTH) with ESMTPA id f090e3s88FmXBkH; Thu, 8 Sep 2016 17:48:33 +0200 (CEST) From: "H. Nikolaus Schaller" To: Laurent Pinchart , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Martinez Canillas , arnd@arndb.de, hans.verkuil@cisco.com, tony@atomide.com, letux-kernel@openphoenux.org, "H. Nikolaus Schaller" Subject: [PATCH] [media] omap3isp: don't call of_node_put Date: Thu, 8 Sep 2016 17:48:33 +0200 Message-Id: X-Mailer: git-send-email 2.7.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP of_node_put() has already been called inside of_graph_get_next_endpoint(). Otherwise we may get warnings like [ 10.118286] omap3isp 480bc000.isp: parsing endpoint /ocp/isp@480bc000/ports/port@0/endpoint, interface 0 [ 10.118499] ERROR: Bad of_node_put() on /ocp/isp@480bc000/ports/port@0/endpoint [ 10.118499] CPU: 0 PID: 968 Comm: udevd Not tainted 4.7.0-rc4-letux+ #376 [ 10.118530] Hardware name: Generic OMAP36xx (Flattened Device Tree) [ 10.118560] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 10.118591] [] (show_stack) from [] (dump_stack+0x98/0xd0) [ 10.118591] [] (dump_stack) from [] (kobject_release+0x60/0x74) [ 10.118621] [] (kobject_release) from [] (__of_get_next_child+0x40/0x48) [ 10.118652] [] (__of_get_next_child) from [] (of_get_next_child+0x28/0x44) [ 10.118652] [] (of_get_next_child) from [] (of_graph_get_next_endpoint+0xe4/0x124) [ 10.118804] [] (of_graph_get_next_endpoint) from [] (isp_probe+0xdc/0xd80 [omap3_isp]) [ 10.118896] [] (isp_probe [omap3_isp]) from [] (platform_drv_probe+0x50/0xa0) [ 10.118927] [] (platform_drv_probe) from [] (driver_probe_device+0x134/0x29c) [ 10.118957] [] (driver_probe_device) from [] (__driver_attach+0x88/0xac) [ 10.118957] [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0x90) [ 10.118957] [] (bus_for_each_dev) from [] (bus_add_driver+0xcc/0x1e8) [ 10.118988] [] (bus_add_driver) from [] (driver_register+0xac/0xf4) [ 10.118988] [] (driver_register) from [] (do_one_initcall+0xac/0x154) [ 10.119018] [] (do_one_initcall) from [] (do_init_module+0x58/0x39c) [ 10.119049] [] (do_init_module) from [] (load_module+0xe5c/0x1004) [ 10.119049] [] (load_module) from [] (SyS_finit_module+0x88/0x90) [ 10.119079] [] (SyS_finit_module) from [] (ret_fast_syscall+0x0/0x1c) Signed-off-by: H. Nikolaus Schaller --- drivers/media/platform/omap3isp/isp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index 5d54e2c..6e2624e 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -2114,7 +2114,6 @@ static int isp_of_parse_nodes(struct device *dev, isd = devm_kzalloc(dev, sizeof(*isd), GFP_KERNEL); if (!isd) { - of_node_put(node); return -ENOMEM; } @@ -2126,7 +2125,7 @@ static int isp_of_parse_nodes(struct device *dev, } isd->asd.match.of.node = of_graph_get_remote_port_parent(node); - of_node_put(node); + if (!isd->asd.match.of.node) { dev_warn(dev, "bad remote port parent\n"); return -EINVAL;