Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp874585pxk; Thu, 17 Sep 2020 19:59:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4FlDGOvRykyPxS1fYcF5dY8VQNm/2gqe89+8l0PwLmRG+al6S14UEBuOGMqhJWKw+FpyY X-Received: by 2002:a17:906:cd0d:: with SMTP id oz13mr33524989ejb.212.1600397964762; Thu, 17 Sep 2020 19:59:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600397964; cv=none; d=google.com; s=arc-20160816; b=KLDULA+DM9pc2xR/Gw3ycq0gIP9OMvT9Z2ROZQRJ4+Dcv1B5enuJM1BckRe94M7M89 /AcgpHkYKvsKxhgNPB4Mtwja1TpyimjtL1EB6CtHRdcjaT+9Zph79hQNd6CUZogi4qlT htv+Q4UWUJLVyJw9ZomxgSUfNBJQGWw3CpbGDcqbW/ZJPIfULbR+Ywrgp2t6d7/GOwVC lHWjkIjzbBnk/DMMhj8M9tR1mwoT8URXzsBg1FTSQAofdrqXr+D6bWGJ0j3GK4E8r+ut 9UBwvvOSTaUMgStYdhMDiiM7RHlmcoCPVCqjx8NbzQIO3OnnjFEMb8XClmBGEZTVfblz xN0w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VDUwjAK1TGfusnkuYf4NwuvkrviVrHMZQOLsG2jZqgs=; b=jiCxoy1ZTap0u0b2it3OPJcMzHsdsHWZCZ39F1yWVZXkMvxDKVk1SBmgirBLD9RtHW zh46T4Z9lYgMF6P2dXiEblhWhMomr9utch7IswrzcOFBvvanvdY/TD4VZcxnARZfr7Il 3gDxQb44666xIm7gT5wIR3wmente5RPUg8Lkz2MXgk9ed19aaH3ZB+idOfUZiTyFlzUe xGdgJJ6JK4aAg20fh/mQMxNnJjd3gcUzGPD7PR4joZnHsrGK5/SXxkbIdBdmIlejSP4C bNq9AsZK/XDz9kXERPr0SvYbN6+1bUXKALIp4dWNaF0F0sg2F6C8XsIuY285NyZ/gm+e K3zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GB0C+t3n; 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 e18si1093419edv.524.2020.09.17.19.59.01; Thu, 17 Sep 2020 19:59:24 -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=GB0C+t3n; 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 S1727877AbgIRCHL (ORCPT + 99 others); Thu, 17 Sep 2020 22:07:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:56154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727798AbgIRCGk (ORCPT ); Thu, 17 Sep 2020 22:06:40 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 59D5E238D6; Fri, 18 Sep 2020 02:06:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394799; bh=2dQoNSLwcFHgL9nUDXpmWel0uijiSICTv+90Rw3dA60=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GB0C+t3n8B+Thngs1CGWIacdmsG2gfYR+U4Z7weCcP38LqYbnzCBJ0emFN8R46R3U PdPUQii4ZDlJf9UdosIuf5JxH0BI/+yEWQ+IrAjhAmF1wed8kpRa+4qJZnIria5yPx X6we+FCVqpQqk9SnR+6BebIWlECrwTK1XD+17JRc= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe JAILLET , Inki Dae , Sasha Levin , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 268/330] drm/exynos: dsi: Remove bridge node reference in error handling path in probe function Date: Thu, 17 Sep 2020 22:00:08 -0400 Message-Id: <20200918020110.2063155-268-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 547a7348633b1f9923551f94ac3157a613d2c9f2 ] 'exynos_dsi_parse_dt()' takes a reference to 'dsi->in_bridge_node'. This must be released in the error handling path. In order to do that, add an error handling path and move the 'exynos_dsi_parse_dt()' call from the beginning to the end of the probe function to ease the error handling path. This function only sets some variables which are used only in the 'transfer' function. The call chain is: .transfer --> exynos_dsi_host_transfer --> exynos_dsi_init --> exynos_dsi_enable_clock (use burst_clk_rate and esc_clk_rate) --> exynos_dsi_set_pll (use pll_clk_rate) While at it, also handle cases where 'component_add()' fails. This patch is similar to commit 70505c2ef94b ("drm/exynos: dsi: Remove bridge node reference in removal") which fixed the issue in the remove function. Signed-off-by: Christophe JAILLET Signed-off-by: Inki Dae Signed-off-by: Sasha Levin --- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c index 8ed94c9948008..b83acd696774b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c @@ -1741,10 +1741,6 @@ static int exynos_dsi_probe(struct platform_device *pdev) dsi->dev = dev; dsi->driver_data = of_device_get_match_data(dev); - ret = exynos_dsi_parse_dt(dsi); - if (ret) - return ret; - dsi->supplies[0].supply = "vddcore"; dsi->supplies[1].supply = "vddio"; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(dsi->supplies), @@ -1805,11 +1801,25 @@ static int exynos_dsi_probe(struct platform_device *pdev) return ret; } + ret = exynos_dsi_parse_dt(dsi); + if (ret) + return ret; + platform_set_drvdata(pdev, &dsi->encoder); pm_runtime_enable(dev); - return component_add(dev, &exynos_dsi_component_ops); + ret = component_add(dev, &exynos_dsi_component_ops); + if (ret) + goto err_disable_runtime; + + return 0; + +err_disable_runtime: + pm_runtime_disable(dev); + of_node_put(dsi->in_bridge_node); + + return ret; } static int exynos_dsi_remove(struct platform_device *pdev) -- 2.25.1