Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3285914pxk; Mon, 21 Sep 2020 09:42:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqCD1rizqVJB8yD6xxO2+Pvbmd6hKzuQW2I+un6P+Y0OfFc0A0xe07LA2Xdd7zoA2YWHLW X-Received: by 2002:a17:906:16da:: with SMTP id t26mr337054ejd.172.1600706550760; Mon, 21 Sep 2020 09:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706550; cv=none; d=google.com; s=arc-20160816; b=BDKbFGz/ZDnf3E3IBWP1AEeVMiwiZA5S9GtVkSfypfa753IfYdAK5AhyDILDGXj1rp aIvjsHJX04h2LT/6wJrZh/ooPkY4ahY/lbQTtkJQQh9rX6/9r+gg0eFJMHtfXumtKatj 160hiRyAKwTdPuP9CAwqcPHEUxTWxE88gCOosCxWvFA4zEujgOogLfsbiNF0MSa1BevL m2MOQuhl78sXbrLwvMNw1/ywb29ZjRD83XgyCOpgv4ruxfjghK6odi3hgDOrnv8o6cwe NNeRrxrb7Zvb44qo10gzZNITVwanuPCIFjAZDQ3AjQVNxYbxNJTlOJc5asiGjC7i66AM Yhkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=p1y+OXqJWzux9Tgy5lUlljJb51iEiKEmb/wVkZYpjcQ=; b=cXueod2RurwbLKJjfWsItFSkKhpQXMH+7EQOIaUqJi2nLGFUQPCUnsy3LERkZiObN5 kZjRuHFwvvtoe5FqNjJvqSgTlOfeYr155oI8iOX5LBLCc+Nhr9rgOquwUj9tAGa0dYH0 yMAKE69Hq2D0HB0uwJOnch/8qm56U9frFT1x7YiT452Nl3ZPziDAb/S2pS3kudI5Oeyn UIPDb9zG+s9XRRG350xjQPXHS9YAiBiYxKoe8Q/IAnWoIRZdAXySvo4Q2kiGUQZgZ7rl StY1YwKv03sC6O3DFuek5yR3Eo3neXU18FBG+aZtC23BdqyG6rLrNNtOcgoUu4qyvl1m XRbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z6C5AUhf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k14si8600239ejx.254.2020.09.21.09.42.07; Mon, 21 Sep 2020 09:42:30 -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=Z6C5AUhf; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729337AbgIUQkU (ORCPT + 99 others); Mon, 21 Sep 2020 12:40:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:42296 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728251AbgIUQj4 (ORCPT ); Mon, 21 Sep 2020 12:39:56 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2766323998; Mon, 21 Sep 2020 16:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706395; bh=oJrYqPbkBNlwRIqbKGRD8Px3cMwSoK4wl8bdpEKC3k4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6C5AUhfOkZnxctkhrNZ59b316wQmMd0YWDCvG9Tn5gAS0HiFPlIZjLurKeO3o/Su tmacRAlOXo4MSvUF6Z/GH2jAx6vJOFn0Jx0XUxMOFID/goPxhzOjx65MbEXZv6oqth eRAweYIJwkz6PzD2MNYm0nHvaAvCgKw4CYIPR66Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Chun-Kuang Hu , Sasha Levin Subject: [PATCH 4.14 82/94] drm/mediatek: Add exception handing in mtk_drm_probe() if component init fail Date: Mon, 21 Sep 2020 18:28:09 +0200 Message-Id: <20200921162039.292601486@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162035.541285330@linuxfoundation.org> References: <20200921162035.541285330@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai [ Upstream commit 64c194c00789889b0f9454f583712f079ba414ee ] mtk_ddp_comp_init() is called in a loop in mtk_drm_probe(), if it fail, previous successive init component is not proccessed. Thus uninitialize valid component and put their device if component init failed. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Yu Kuai Signed-off-by: Chun-Kuang Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 670662128edd2..f32645a33cc90 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -538,8 +538,13 @@ err_pm: pm_runtime_disable(dev); err_node: of_node_put(private->mutex_node); - for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) + for (i = 0; i < DDP_COMPONENT_ID_MAX; i++) { of_node_put(private->comp_node[i]); + if (private->ddp_comp[i]) { + put_device(private->ddp_comp[i]->larb_dev); + private->ddp_comp[i] = NULL; + } + } return ret; } -- 2.25.1