drm/tegra: hub: Do not enable orphaned window group
authorNicolin Chen <nicoleotsuka@gmail.com>
Tue, 19 May 2020 09:03:01 +0000 (02:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 06:13:12 +0000 (08:13 +0200)
commitceea8871fc9a6af90ea1f1595b9368a5595d61d4
treed6f93a5eb30b7b500c9dd31eb9c842557debf574
parent5689ddf2dd7db1dafa101d3e2be9aba44ed25fae
drm/tegra: hub: Do not enable orphaned window group

[ Upstream commit ef4e417eb3ec7fe657928f10ac1d2154d8a5fb38 ]

Though the unconditional enable/disable code is not a final solution,
we don't want to run into a NULL pointer situation when window group
doesn't link to its DC parent if the DC is disabled in Device Tree.

So this patch simply adds a check to make sure that window group has
a valid parent before running into tegra_windowgroup_enable/disable.

Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/tegra/hub.c