mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 02:40:52 +07:00
drm/panfrost: Use kvfree() to free bo->sgts
Use kvfree() to free bo->sgts, because the memory is allocated with
kvmalloc_array() in panfrost_mmu_map_fault_addr().
Fixes: 187d292920
("drm/panfrost: Add support for GPU heap allocations")
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200608151728.234026-1-efremov@linux.com
This commit is contained in:
parent
64092598c4
commit
114427b892
@ -46,7 +46,7 @@ static void panfrost_gem_free_object(struct drm_gem_object *obj)
|
||||
sg_free_table(&bo->sgts[i]);
|
||||
}
|
||||
}
|
||||
kfree(bo->sgts);
|
||||
kvfree(bo->sgts);
|
||||
}
|
||||
|
||||
drm_gem_shmem_free_object(obj);
|
||||
|
@ -486,7 +486,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
|
||||
pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT,
|
||||
sizeof(struct page *), GFP_KERNEL | __GFP_ZERO);
|
||||
if (!pages) {
|
||||
kfree(bo->sgts);
|
||||
kvfree(bo->sgts);
|
||||
bo->sgts = NULL;
|
||||
mutex_unlock(&bo->base.pages_lock);
|
||||
ret = -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user