Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp568615ybi; Fri, 21 Jun 2019 04:34:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUCPfK5OyDTFzJeY1DWx30ez2huBmgTQVlbdJ1TYhHvePxWhBSIrdhKHIHWhO/v7q3MybB X-Received: by 2002:a17:902:42a5:: with SMTP id h34mr94905095pld.16.1561116849425; Fri, 21 Jun 2019 04:34:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561116849; cv=none; d=google.com; s=arc-20160816; b=ibijZuAjJMw3ZWm2OnDiagUU4N/R5AeJnmUTZPPI++DAUvudZxV+Hmq9gEGdnNd128 ZjW3EG41KetCvEglbzNgenOHnwHl8e+flC9vJVEzNQaUDV5m1NzmXGD4N1njeQJwtuN8 hO5i3YoCyDPfp3a7ejya7WsvjHaXDFIgS/wXUlggl9UEvDX4+rA1wxxD6PsdutDzrjMs PkNCn1FfsbpGzCrWoBe9XNe8vw5/vlGJsiEDRlHr96Q0pDFH3u90iXeTjUJRVCM0CL/0 UiaVt/dZoMFqmufeaVmMqEZm7wuz2YrFV2OCmJmfQ03XDwp0vpFGn6fwWJDU/N2hf1FG Bfnw== 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 :message-id:date:subject:cc:to:from; bh=8Dkz5VYMY7MKL2bcP2Stqljzp+ya6htDM8G2gEfTork=; b=WXrm+MCojsoXIPIoS/J6YSAuSP63hS33RksjoCRxDvPgPMjqOLeXP4+XnyweIsAOjC JrnUPviwEYzUKNYn8qbNIZ0ZaRsvyODU+VP129jFghFGUBc+pwRDInQ1UViinL5UTzQP gO95Bym8ojXW47iSEx6eOFcO+gx1GnRX3CAjHoYPePDWVqNb7Jhbyz5q/ZdM0W5oRXmT RSHSXgg05RCalicWPZJDVyvZG4TE4vgWoVyUzap1OHVR6pGC3tstjGsv+SL6IcvEX48d s4tPEVSaIi8T3cSb3T0VWSUAASVwppIsMc0XXwoSC4iwwuOqyq1TPVlJXOTujLWAnx36 jQmQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci23si2636403pjb.106.2019.06.21.04.33.52; Fri, 21 Jun 2019 04:34:09 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726706AbfFULdU (ORCPT + 99 others); Fri, 21 Jun 2019 07:33:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:48832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbfFULdU (ORCPT ); Fri, 21 Jun 2019 07:33:20 -0400 Received: from ziggy.de (unknown [37.223.141.54]) (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 E1DE12084E; Fri, 21 Jun 2019 11:33:17 +0000 (UTC) From: Matthias Brugger To: minghsiu.tsai@mediatek.com, houlong.wei@mediatek.com, andrew-ct.chen@mediatek.com, mchehab@kernel.org, djkurtz@chromium.org Cc: linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Matthias Brugger Subject: [PATCH] [media] media: mtk-mdp: fix reference count on old device tree Date: Fri, 21 Jun 2019 13:32:50 +0200 Message-Id: <20190621113250.4946-1-matthias.bgg@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_get_next_child() increments the reference count of the returning device_node. Decrement it in the check if we are using the old or the new DTB. Fixes: ba1f1f70c2c0 ("[media] media: mtk-mdp: Fix mdp device tree") Signed-off-by: Matthias Brugger --- drivers/media/platform/mtk-mdp/mtk_mdp_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c index bbb24fb95b95..bafe53c5d54a 100644 --- a/drivers/media/platform/mtk-mdp/mtk_mdp_core.c +++ b/drivers/media/platform/mtk-mdp/mtk_mdp_core.c @@ -118,7 +118,9 @@ static int mtk_mdp_probe(struct platform_device *pdev) mutex_init(&mdp->vpulock); /* Old dts had the components as child nodes */ - if (of_get_next_child(dev->of_node, NULL)) { + parent = of_get_next_child(dev->of_node, NULL); + if (parent) { + of_node_put(parent); parent = dev->of_node; dev_warn(dev, "device tree is out of date\n"); } else { -- 2.21.0