Skip to content

Commit

Permalink
[HACK?]rcar_du_vs: zero-out sg_tables on plane duplication
Browse files Browse the repository at this point in the history
Zero-out sg_tables in original plane, efectively introducing move
semantic. Seems, this fixes issue with double-free,
when rcar_du_vsp_plane_cleanup_fb() freed the same sg_table
both in original plane and in the copy.

Signed-off-by: Volodymyr Babchuk <[email protected]>
Reviewed-by: Oleksandr Andrushchenko <[email protected]>
  • Loading branch information
lorc authored and Iurii Artemenko committed Jul 31, 2018
1 parent 2a03015 commit 7535120
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/rcar-du/rcar_du_vsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,8 @@ rcar_du_vsp_plane_atomic_duplicate_state(struct drm_plane *plane)
if (copy == NULL)
return NULL;

memset(state->sg_tables, 0, sizeof(state->sg_tables));

__drm_atomic_helper_plane_duplicate_state(plane, &copy->state);

return &copy->state;
Expand Down

0 comments on commit 7535120

Please sign in to comment.