From 803ea4d43693da78d4781195d831d412716e96b4 Mon Sep 17 00:00:00 2001 From: Dom Cobley Date: Wed, 27 Apr 2022 14:45:35 +0100 Subject: [PATCH] drm/vc4_kms: Protect hvs dereference on fkms fkms has a null hvs pointer so this crashes. Protect against it Signed-off-by: Dom Cobley --- drivers/gpu/drm/vc4/vc4_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 190aade..064093a 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -354,7 +354,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state) struct vc4_hvs_state *new_hvs_state; struct drm_crtc *crtc; struct vc4_hvs_state *old_hvs_state; - unsigned long max_clock_rate = clk_get_max_rate(hvs->core_clk); + unsigned long max_clock_rate = hvs ? clk_get_max_rate(hvs->core_clk) : 0; unsigned int channel; int i; -- 2.7.4