A likely culprit is that the map variable is not zero initialized in gud_prep_flush() so map->is_iomem can be any value:
static int gud_prep_flush(struct gud_device *gdrm, struct drm_framebuffer *fb,
const struct drm_format_info *format, struct drm_rect *rect,
struct gud_set_buffer_req *req)
{
struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
u8 compression = gdrm->compression;
struct dma_buf_map map[DRM_FORMAT_MAX_PLANES];
struct dma_buf_map map_data[DRM_FORMAT_MAX_PLANES];
void *vaddr, *buf;
size_t pitch, len;
int ret = 0;
pitch = drm_format_info_min_pitch(format, 0, drm_rect_width(rect));
len = pitch * drm_rect_height(rect);
if (len > gdrm->bulk_len)
return -E2BIG;
ret = drm_gem_fb_vmap(fb, map, map_data);
if (ret)
return ret;
I wonder why dma_buf_map_clear() has conditional clearing and not just zero the whole structure, that would solve the problem as well for all users I guess:
include/linux/dma-buf-map.h
A likely culprit is that the
map
variable is not zero initialized in gud_prep_flush() somap->is_iomem
can be any value:I wonder why dma_buf_map_clear() has conditional clearing and not just zero the whole structure, that would solve the problem as well for all users I guess: