Skip to content

Commit 7245e62

Browse files
Alexandr SapozhnikovThomas Zimmermann
authored andcommitted
drm/cirrus: NULL-check pipe->plane.state->fb in cirrus_pipe_update()
After having been compared to NULL value at cirrus.c:455, pointer 'pipe->plane.state->fb' is passed as 1st parameter in call to function 'cirrus_fb_blit_rect' at cirrus.c:461, where it is dereferenced at cirrus.c:316. Found by Linux Verification Center (linuxtesting.org) with SVACE. v2: * aligned commit message to line-length limits Signed-off-by: Alexandr Sapozhnikov <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a950b98 commit 7245e62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/tiny/cirrus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
455455
if (state->fb && cirrus->cpp != cirrus_cpp(state->fb))
456456
cirrus_mode_set(cirrus, &crtc->mode, state->fb);
457457

458-
if (drm_atomic_helper_damage_merged(old_state, state, &rect))
458+
if (state->fb && drm_atomic_helper_damage_merged(old_state, state, &rect))
459459
cirrus_fb_blit_rect(state->fb, &shadow_plane_state->data[0], &rect);
460460
}
461461

0 commit comments

Comments
 (0)