mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: fix memory leak in case of failure
In __gk20a_alloc_pages(), if we fail to allocate a chunk we free previously allocated chunks in error path But we do not free up the memory reserved in those chunks which could lead to OOM situations Fix this by calling gk20a_free() for each chunk in error path Jira DNVGPU-96 Change-Id: I68aa18d68a5282405016e688c790ccbc0c2a0d69 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/1203098 (cherry picked from commit f096bd1675600f4e2fc2d686f2911bb945fbbf0b) Reviewed-on: http://git-master/r/1210952 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
3b6819bdf4
commit
50fec50bff
@@ -200,6 +200,7 @@ fail_cleanup:
|
||||
c = list_first_entry(&alloc->alloc_chunks,
|
||||
struct page_alloc_chunk, list_entry);
|
||||
list_del(&c->list_entry);
|
||||
gk20a_free(&a->source_allocator, c->base);
|
||||
kfree(c);
|
||||
}
|
||||
kfree(alloc);
|
||||
|
||||
Reference in New Issue
Block a user