[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230621223311.2239547-4-jonas@kwiboo.se>
Date: Wed, 21 Jun 2023 22:33:20 +0000 (UTC)
From: Jonas Karlman <jonas@...boo.se>
To: Sandy Huang <hjc@...k-chips.com>, Heiko Stuebner <heiko@...ech.de>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
Cc: Mark Yao <markyao0591@...il.com>,
Andy Yan <andy.yan@...k-chips.com>,
Sascha Hauer <s.hauer@...gutronix.de>,
dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
Jonas Karlman <jonas@...boo.se>
Subject: [PATCH v2 3/5] drm/rockchip: vop: Fix call to crtc reset helper
Allocation of crtc_state may fail in vop_crtc_reset, causing an invalid
pointer to be passed to __drm_atomic_helper_crtc_reset.
Fix this by adding a NULL check of crtc_state, similar to other drivers.
Fixes: 01e2eaf40c9d ("drm/rockchip: Convert to using __drm_atomic_helper_crtc_reset() for reset.")
Signed-off-by: Jonas Karlman <jonas@...boo.se>
---
v2:
- New patch
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index 25c873d4ff53..23bc79064e78 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -1630,7 +1630,10 @@ static void vop_crtc_reset(struct drm_crtc *crtc)
if (crtc->state)
vop_crtc_destroy_state(crtc, crtc->state);
- __drm_atomic_helper_crtc_reset(crtc, &crtc_state->base);
+ if (crtc_state)
+ __drm_atomic_helper_crtc_reset(crtc, &crtc_state->base);
+ else
+ __drm_atomic_helper_crtc_reset(crtc, NULL);
}
#ifdef CONFIG_DRM_ANALOGIX_DP
--
2.41.0
Powered by blists - more mailing lists