Message ID | 20201120102545.4047-10-tzimmermann@suse.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/fb-helper: Various fixes and cleanups | expand |
On Fri, Nov 20, 2020 at 11:25:44AM +0100, Thomas Zimmermann wrote: > Copy the vmap()'ed instance of struct dma_buf_map before modifying it, > in case the implementation of vunmap() depends on the exact address. > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org>
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index b36d9852cdf7..d972ce75d180 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -395,14 +395,15 @@ static int drm_fb_helper_damage_blit(struct drm_fb_helper *fb_helper, struct drm_clip_rect *clip) { struct drm_client_buffer *buffer = fb_helper->buffer; - struct dma_buf_map map; + struct dma_buf_map map, dst; int ret; ret = drm_client_buffer_vmap(buffer, &map); if (ret) return ret; - drm_fb_helper_damage_blit_real(fb_helper, clip, &map); + dst = map; + drm_fb_helper_damage_blit_real(fb_helper, clip, &dst); drm_client_buffer_vunmap(buffer);
Copy the vmap()'ed instance of struct dma_buf_map before modifying it, in case the implementation of vunmap() depends on the exact address. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/gpu/drm/drm_fb_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)