drm/omap: fix NULL but dereferenced coccicheck error

[ Upstream commit 8f2a3970c9 ]

Fix the following coccicheck warning:
./drivers/gpu/drm/omapdrm/omap_overlay.c:89:22-25: ERROR: r_ovl is NULL
but dereferenced.

Here should be ovl->idx rather than r_ovl->idx.

Fixes: e02b5cc9e8 ("drm/omap: Add a 'right overlay' to plane state")
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220307095612.409090-1-wanjiabing@vivo.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Wan Jiabing 2022-03-07 17:56:12 +08:00 committed by Greg Kroah-Hartman
parent 4e1e37d198
commit d2507be660

View file

@ -86,7 +86,7 @@ int omap_overlay_assign(struct drm_atomic_state *s, struct drm_plane *plane,
r_ovl = omap_plane_find_free_overlay(s->dev, overlay_map,
caps, fourcc);
if (!r_ovl) {
overlay_map[r_ovl->idx] = NULL;
overlay_map[ovl->idx] = NULL;
*overlay = NULL;
return -ENOMEM;
}