OSDN Git Service

ion: fix a possible memory leak in ion_cma_allocate
authorSuren Baghdasaryan <surenb@google.com>
Thu, 18 Apr 2019 19:42:44 +0000 (12:42 -0700)
committer0ranko0P <ranko0p@outlook.com>
Tue, 24 Dec 2019 20:42:41 +0000 (04:42 +0800)
commit03f8f78956363cbaa30bb3a7b4ad678c5d804e76
treec0ecec452712455d2208c75e282018076f3133d5
parent08e3325b87b303f242525461eba72f786c9eb203
ion: fix a possible memory leak in ion_cma_allocate

The memory leak occurs when kmalloc() for info->table fails, info is freed
but info->cpu_addr allocation is left.
Fixes: eeeb940746de ("ion: add snapshot of ion support for MSM")

Bug: 130817249
Test: builds and boots
Change-Id: I7faf5be5129a46b2f874f4e3803470e5f5130a21
Reported-by: Mikael Magnusson <Mikael.Magnusson@sony.com>
Suggested-by: Mikael Magnusson <Mikael.Magnusson@sony.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
drivers/staging/android/ion/ion_cma_heap.c