drm/omap: fix NULL but dereferenced coccicheck error
Subsystems (3)
PATCH 1/1 drm/omap: fix NULL but dereferenced coccicheck error
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.
Signed-off-by Wan Jiabing <[email protected]>
--- drivers/gpu/drm/omapdrm/omap_overlay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_overlay.c +1 -1
@@ -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 ; }
Signature · 1 line
2.35.1
Hi,
Quoted 16 lines · Wan Jiabing
Fix the following coccicheck warning:
./drivers/gpu/drm/omapdrm/omap_overlay.c:89:22-25: ERROR:r_ovlis NULL but dereferenced.Here should be
ovl->idxrather thanr_ovl->idx.Signed-off-by Wan Jiabing <[email protected]>--- drivers/gpu/drm/omapdrm/omap_overlay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/omapdrm/omap_overlay.c +0
-0
drivers/gpu/drm/omapdrm/omap_overlay.c int omap_overlay_assign(struct drm_atomic_state *s, struct drm_plane *plane, · line 92
Quoted 8 lines
drivers/gpu/drm/omapdrm/omap_overlay.c +1
-1@@ -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 ; }
Thanks, I'll pick this up.
Tomi