Skip to content

Commit 114427b

Browse files
evdenisSteven Price
authored andcommitted
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: 187d292 ("drm/panfrost: Add support for GPU heap allocations") Cc: [email protected] Signed-off-by: Denis Efremov <[email protected]> Reviewed-by: Steven Price <[email protected]> Signed-off-by: Steven Price <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6409259 commit 114427b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/gpu/drm/panfrost/panfrost_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void panfrost_gem_free_object(struct drm_gem_object *obj)
4646
sg_free_table(&bo->sgts[i]);
4747
}
4848
}
49-
kfree(bo->sgts);
49+
kvfree(bo->sgts);
5050
}
5151

5252
drm_gem_shmem_free_object(obj);

drivers/gpu/drm/panfrost/panfrost_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static int panfrost_mmu_map_fault_addr(struct panfrost_device *pfdev, int as,
486486
pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT,
487487
sizeof(struct page *), GFP_KERNEL | __GFP_ZERO);
488488
if (!pages) {
489-
kfree(bo->sgts);
489+
kvfree(bo->sgts);
490490
bo->sgts = NULL;
491491
mutex_unlock(&bo->base.pages_lock);
492492
ret = -ENOMEM;

0 commit comments

Comments
 (0)