[PATCH v2 1/2] drm/tilcdc: Check drm_fb_cma_get_gem_obj() return value
Jyri Sarha
jsarha at ti.com
Wed Mar 13 17:25:23 UTC 2019
Clockwork, a static code analysis SW, complains about
drm_fb_cma_get_gem_obj() possibly returning NULL. This should never
happen with the frame-buffers used by tilcdc. However, returning null
is still a part of the drm_fb_cma_get_gem_obj() API, so lets make
Clockwork quiet by adding a simple check with WARN.
Signed-off-by: Jyri Sarha <jsarha at ti.com>
---
drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
index 1067e702c22c..bc9f859f45dc 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
@@ -75,6 +75,8 @@ static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb)
u64 dma_base_and_ceiling;
gem = drm_fb_cma_get_gem_obj(fb, 0);
+ if (WARN_ON(!gem)) /* Make Clockwork quiet. Should never happen. */
+ return;
start = gem->paddr + fb->offsets[0] +
crtc->y * fb->pitches[0] +
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
More information about the dri-devel
mailing list