Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3515965pxk; Mon, 7 Sep 2020 15:58:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEGtKPrSm/XB7kNEvQ6qvEzrGW8iHQVi1j/6YODe1aavCs88psF/hV9l5tbJG0QVe5ihx1 X-Received: by 2002:a50:fd19:: with SMTP id i25mr24270907eds.142.1599519502929; Mon, 07 Sep 2020 15:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599519502; cv=none; d=google.com; s=arc-20160816; b=H5bJOBU9V4Hs1fyLrQ97JR4ChuQA97GIz8fwUjCWNB8+mGbffk4Z9HpydWqukdf6uA OSdIa8oSazIIqqverG+ONsVQ4+xCbqyRe69HZXAaTT8ka9i25j281T43suGvD7NZIGv4 eMAYhvQcH6F5EPXU+JyySZjq1kiaewwaqxC6MITKqfYuuyL9oT2qpVub5IjNEzFfu8y9 gHSHv3C5iQsix+Af4sWvfka2zaKH5Vd3RDQ1VV62t6aWpPwsm8kY9JAhmPdhFMAirJoZ jUkeGlscmNSsFACUlTEB53effFrVwsLGlnR4B22o/cuY9jGYp5Dom5Ld8tk3oQDdb9RH V+kw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=QKYHVthkUyLoBkq0yLOgAHZb9jaywnFVUdSfUVdXTwc=; b=ppyp4dxoRnz06YCk3kAMISRMv8bVBDym+dxra4Zw76h6p7QeGEheBc2GgrfijJiyTa YxQ3bFTjYRHPbRVJ8OM4F8PvJTeA4BQvTJu34g/fKrvIzIe5iQeUrLVBkoeDsYOEcD1w EAxeFNF7cwXUFk3Lcm/d6BwyZyBjE/vGyIb4o1H6cmICCGlb1jJmyu0WuI5AURxSoybo yn6guOkufzjm/f9AdLO+hdO8+lP708Sh5XIrvpzHZGCXZFtszf+AWdmtV2GxwoOlcUoT O0AMKr3kimfy6WB0fcw33quYxvl1jbSOiluRV9UvHtDC5RXy9irUY+mA9qIhpCrOLpks IGvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DYL874Ft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec7si10549194ejb.359.2020.09.07.15.57.59; Mon, 07 Sep 2020 15:58:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DYL874Ft; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728101AbgIGW4x (ORCPT + 99 others); Mon, 7 Sep 2020 18:56:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:59368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727119AbgIGW4v (ORCPT ); Mon, 7 Sep 2020 18:56:51 -0400 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 0D04A2193E for ; Mon, 7 Sep 2020 22:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599519411; bh=NSfi6wd9qqZTJhGfu2dBWUH/ZuOy9FYmKPjqOXlrGdY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DYL874Ft8lJajzJzSkE08InkYufgly609Dly2f3AmCFg0kllg6SfudOSXe7qRMWqI xAJPQVXK02BLjsfoDOaCNPQJIOwBt85PQQ+6cOclK8lu1CxEiMMxAwcxMiDFBc1SXZ 1Pahyg0bnLv9oV4C/+D8CSqc7CPBTzlO8tk79p0w= Received: by mail-ed1-f52.google.com with SMTP id t16so9247361edw.7 for ; Mon, 07 Sep 2020 15:56:50 -0700 (PDT) X-Gm-Message-State: AOAM531jhAQ85CylLCInTiNnR/qlZldyr5neRdOdsK+g2ff/VJF4hwrS iotxGLt35sBriIsSiRX8ReRmNeQx4UmIpUE5TQ== X-Received: by 2002:a05:6402:1451:: with SMTP id d17mr23241583edx.48.1599519409620; Mon, 07 Sep 2020 15:56:49 -0700 (PDT) MIME-Version: 1.0 References: <20200905083058.1631726-1-yukuai3@huawei.com> In-Reply-To: <20200905083058.1631726-1-yukuai3@huawei.com> From: Chun-Kuang Hu Date: Tue, 8 Sep 2020 06:56:36 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/mediatek: add missing put_device() call in mtk_ddp_comp_init() To: Yu Kuai Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , yt.shen@mediatek.com, CK Hu , Bibby Hsieh , Yongqiang Niu , DRI Development , Linux ARM , "moderated list:ARM/Mediatek SoC support" , linux-kernel , yi.zhang@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yu Kuai: Yu Kuai =E6=96=BC 2020=E5=B9=B49=E6=9C=885=E6=97=A5 = =E9=80=B1=E5=85=AD =E4=B8=8B=E5=8D=884:31=E5=AF=AB=E9=81=93=EF=BC=9A > > if of_find_device_by_node() succeed, mtk_ddp_comp_init() doesn't have > a corresponding put_device(). Thus add put_device() to fix the exception > handling for this function implementation. > This patch looks good to me, but I find another thing related to this. mtk_ddp_comp_init() is called in a loop in mtk_drm_probe(), when this component init fail, I think we should uninitialize previous successive init component and put their device. Would you like to make this patch more complete? Regards, Chun-Kuang. > Fixes: d0afe37f5209 ("drm/mediatek: support CMDQ interface in ddp compone= nt") > Signed-off-by: Yu Kuai > --- > drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c b/drivers/gpu/dr= m/mediatek/mtk_drm_ddp_comp.c > index 57c88de9a329..526648885b97 100644 > --- a/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c > +++ b/drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c > @@ -496,6 +496,7 @@ int mtk_ddp_comp_init(struct device *dev, struct devi= ce_node *node, > #if IS_REACHABLE(CONFIG_MTK_CMDQ) > if (of_address_to_resource(node, 0, &res) !=3D 0) { > dev_err(dev, "Missing reg in %s node\n", node->full_name)= ; > + put_device(&larb_pdev->dev); > return -EINVAL; > } > comp->regs_pa =3D res.start; > -- > 2.25.4 >