Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp541524ybi; Fri, 12 Jul 2019 00:25:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrNuBj7Iww9wEQ5qF2I8VJrNf3nzYnVrPdaHtcJsiJozYmRkla+lT+SJNhSHHhIQjwcctC X-Received: by 2002:a17:90a:9dca:: with SMTP id x10mr9987769pjv.100.1562916322732; Fri, 12 Jul 2019 00:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562916322; cv=none; d=google.com; s=arc-20160816; b=XKrQZVfNB6PER7lixFFVqVwpIv1WmhXvUpWv41WSBuquQzR4si7NdJxuR3FSUdrhem TATvpFeRER7xHCyXX1a6MG4Qcsvlgv25jv3Avg+d7a6zHXJe526o4TpESJXJOGsRPd6+ SrwqJYROC9QkUAOBjgh2r3QuLPvbq5id3M9wV6vc14rCBTUZzgGwgIwEweFG6Yzthenb EJ7YwHAhulxndtfpfJZPf5If13GEV81Spz7IXTiQoFh+02LSKeB6sFiP96Q1BXZYeSzD u0MCz9C3MIrjbs/r8ROXeGKpB36lY5Zy1PXOPAM/ZkRZA5l93cgF6Q3VLWsko5v/Nw+o bWAw== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=GdZHACxJhnGDtBzuOUrL3XWUydk++0/jZwXk5jeAz9g=; b=id0ysjOHyfD5bBnnKg/6feifl8Qq32rTw9tA/YCidcuyhxR6CqywI+odQEO1TY5lmm TartKpJNeKjCj5xMYaLduzf8y4q0vEuibFvDwvoGcM5oTY/UPMPiZkpCj6StDC0XCfPc lKrRjoDWHNb6s3BqmsP2QLH+DDw8YazxC5A99HDutr/5JUMj6Bd9h0FT66o99JhB7Z0m n0TsXcCI/+xT9hJ0DYoUiYNNyYqPHBrszLLSdKOVcPMwTk+YR9Iss6f2W+qB2pmgFn5E /HP6Vz9SrxXHi/grufudQH/hSNvZSklOVHF6MkjKmSKsDomRqak+7ub2yMurLFi2Un/S pIbw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14si7260317pjo.40.2019.07.12.00.25.06; Fri, 12 Jul 2019 00:25:22 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726205AbfGLHXq (ORCPT + 99 others); Fri, 12 Jul 2019 03:23:46 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:56797 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726033AbfGLHXq (ORCPT ); Fri, 12 Jul 2019 03:23:46 -0400 X-UUID: bdd7fe42907544eebcbbb88dcb5f0f9e-20190712 X-UUID: bdd7fe42907544eebcbbb88dcb5f0f9e-20190712 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1226092318; Fri, 12 Jul 2019 15:23:40 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 12 Jul 2019 15:23:38 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 12 Jul 2019 15:23:38 +0800 Message-ID: <1562916217.29653.4.camel@mhfsdcap03> Subject: Re: [PATCH] [media] media: mtk-mdp: fix reference count on old device tree From: houlong wei To: Matthias Brugger CC: Minghsiu Tsai =?UTF-8?Q?=28=E8=94=A1=E6=98=8E=E4=BF=AE=29?= , Andrew-CT Chen =?UTF-8?Q?=28=E9=99=B3=E6=99=BA=E8=BF=AA=29?= , "mchehab@kernel.org" , "djkurtz@chromium.org" , Hans Verkuil , "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" Date: Fri, 12 Jul 2019 15:23:37 +0800 In-Reply-To: References: <20190621113250.4946-1-matthias.bgg@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-07-08 at 17:06 +0800, Matthias Brugger wrote: > > On 21/06/2019 13:32, Matthias Brugger wrote: > > 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 > > Any comments on that? > Hi Matthias, Thanks for fixing the bug. Sorry to reply late~ Acked-by: Houlong Wei > > --- > > 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 { > >