Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evdi_gem: Fix null pointer deference #1

Merged
merged 1 commit into from
Feb 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion module/evdi_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,18 @@ static void evdi_gem_put_pages(struct evdi_gem_object *obj)

int evdi_gem_vmap(struct evdi_gem_object *obj)
{
#if KERNEL_VERSION(5, 11, 0) <= LINUX_VERSION_CODE
struct dma_buf_map map;
#endif
int page_count = obj->base.size / PAGE_SIZE;
int ret;

if (obj->base.import_attach) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0)
obj->vmapping = dma_buf_vmap(obj->base.import_attach->dmabuf);
#else
dma_buf_vmap(obj->base.import_attach->dmabuf, obj->vmapping);
dma_buf_vmap(obj->base.import_attach->dmabuf, &map);
obj->vmapping = map.vaddr;
#endif
if (!obj->vmapping)
return -ENOMEM;
Expand Down