From patchwork Sun Nov 4 13:11:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 10666863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CACD13BF for ; Sun, 4 Nov 2018 13:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D4D4299E5 for ; Sun, 4 Nov 2018 13:11:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3ADB299FF; Sun, 4 Nov 2018 13:11:32 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 6D9A1299E5 for ; Sun, 4 Nov 2018 13:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729838AbeKDW0X (ORCPT ); Sun, 4 Nov 2018 17:26:23 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33208 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729496AbeKDW0X (ORCPT ); Sun, 4 Nov 2018 17:26:23 -0500 Received: by mail-pl1-f196.google.com with SMTP id x6-v6so3138270pln.0 for ; Sun, 04 Nov 2018 05:11:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ujLPgAjWV7PaX3fjz76F+7Ka5uefbT/8TaxunJPtuxI=; b=nH3EC2h7ZQc2L/iTnwwQ0beFMFWpgWUJTJmHdf/ZJZZLL+1GKEIQ5WiPVZHH4ESFOF UqRXRFkx2GRWAr1gfuwKVbwJ5SiyXz0Hcib+fVcxc2pYahK4PJjF5lf74bcpU5jYhP8p 0h4sOvWkSm9Emj54ufoc2QfCj8rcenM/WMXBTod9RPc768olbaVTHyH8OGTui3e3Gk7Q FWCKENLiCuiW8TOkQUpRvAI/lbaAGCMavMf8nquSsEMcnTd1+2xxbEkc9v0Rr2XOg7AP CsOhVW23COJyuYfsRAcB5GP72UKp1fvk65Ysn08zYpoTdQqz/joV7YPdldcsOH7VwlMx mPww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ujLPgAjWV7PaX3fjz76F+7Ka5uefbT/8TaxunJPtuxI=; b=tLiAO9IeyqaIo8A9ed2ep33E2Ui1A3F7WmFafYCTQ3sv61+korzkWD8Lp3jWhfAKnc q1EggHsKBJnC2IZAf+nifYEI1zL7Bz1JHERiX5Z+r3IiMVbrTnU3Y6A1kWuzvY1k8ksk PL/c4OIUiU3cgPWs0wr/Pz9o1y2m1Fp6Rb+4mc4Zc3dJrPYtxMRKC4UclbudZheYmpkA /P5moVtKAT9tqeuit1hdfgZBxU+9TVqULKB6fCTIa9N23F9NLQTa02ZEUEtVAIKgglzp GEnkmgTLyaX5H7r7eKBJOTHULqghD88zQW5r8aQJr4nZRQCDRIz1+JN6iCfEE1Otek0Z PhQg== X-Gm-Message-State: AGRZ1gJMsB1mznM9DzB3XsSqQl/nGwJAS2gPsZeMNId0xdnf0nLA+bKr MA6IVL+5ac5+4uXhVKNn6ZTFBd2D X-Google-Smtp-Source: AJdET5fMH7ZR1bVrgeLGxMl/GZKgTCkly7xaGg5jInPDc6wTUmgMQJ76kt7BLqdi3WTXG5U+86kSGA== X-Received: by 2002:a17:902:7146:: with SMTP id u6-v6mr18084624plm.322.1541337086025; Sun, 04 Nov 2018 05:11:26 -0800 (PST) Received: from mita-MS-7A45.lan ([240f:34:212d:1:ad72:e551:f8c6:1a92]) by smtp.gmail.com with ESMTPSA id u12-v6sm37397074pfi.83.2018.11.04.05.11.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 04 Nov 2018 05:11:25 -0800 (PST) From: Akinobu Mita To: linux-media@vger.kernel.org Cc: Akinobu Mita , Steve Longerbeam , Hyun Kwon , Laurent Pinchart , Mauro Carvalho Chehab Subject: [PATCH] media: xilinx-video: fix bad of_node_put() on endpoint error Date: Sun, 4 Nov 2018 22:11:10 +0900 Message-Id: <1541337070-4917-1-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 2.7.4 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 The fwnode_graph_get_next_endpoint() returns an 'endpoint' node pointer with refcount incremented, and refcount of the passed as a previous 'endpoint' node is decremented. So when iterating over all nodes using fwnode_graph_get_next_endpoint(), we don't need to call fwnode_handle_put() for each node except for error exit paths. Otherwise we get "OF: ERROR: Bad of_node_put() on ..." messages. Fixes: d079f94c9046 ("media: platform: Switch to v4l2_async_notifier_add_subdev") Cc: Steve Longerbeam Cc: Hyun Kwon Cc: Laurent Pinchart Cc: Mauro Carvalho Chehab Signed-off-by: Akinobu Mita --- drivers/media/platform/xilinx/xilinx-vipp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index 574614d..26b13fd 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -377,8 +377,6 @@ static int xvip_graph_parse_one(struct xvip_composite_device *xdev, goto err_notifier_cleanup; } - fwnode_handle_put(ep); - /* Skip entities that we have already processed. */ if (remote == of_fwnode_handle(xdev->dev->of_node) || xvip_graph_find_entity(xdev, remote)) {