mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: free slabs in page_allocator_init fail
Currently, nvgpu_page_allocator_init() doesn't free allocated slabs if function fails initializing buddy_allocator. This patch frees allocated slabs in fail path. Jira NVGPU-3107 Change-Id: I17d735e7d664c1ddcbeab04129c4baca1581fe1e Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2092769 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
32eea0988c
commit
931edb9d52
@@ -1085,6 +1085,9 @@ int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (a->slabs != NULL) {
|
||||
nvgpu_kfree(g, a->slabs);
|
||||
}
|
||||
if (a->alloc_cache != NULL) {
|
||||
nvgpu_kmem_cache_destroy(a->alloc_cache);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user