diff options
| author | Shangbing Hu <shangbing.hu@mediatek.com> | 2016-07-13 02:08:25 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-09-25 17:45:04 +0200 |
| commit | 35dca1331709d1f469041e6e896172df1df3db6a (patch) | |
| tree | b415c61c657e8e746cb9a5e321c89bb65b5b98be | |
| parent | d5eda7577c2c39d5081933dc8c15af75edf49ff2 (diff) | |
ion: kmemleak
[Detail] heap_data need to be free after used
[Solution] free heap_data to avoid kmemleak
MTK-Commit-Id: 7011735a00a6b8ae9b8df045c9be12d955f5a526
Change-Id: I3362db1e3c8b674c9bdfbf8aacfc2e850b994695
Signed-off-by: Shangbing Hu <shangbing.hu@mediatek.com>
CR-Id: ALPS02418280
Feature: Memory Optimization
| -rw-r--r-- | drivers/staging/android/ion/mtk/ion_fb_heap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/mtk/ion_fb_heap.c b/drivers/staging/android/ion/mtk/ion_fb_heap.c index c0a69e7f7..9b5223b5c 100644 --- a/drivers/staging/android/ion/mtk/ion_fb_heap.c +++ b/drivers/staging/android/ion/mtk/ion_fb_heap.c @@ -285,6 +285,8 @@ int ion_drv_create_FB_heap(ion_phys_addr_t fb_base, size_t fb_size) heap_data = kzalloc(sizeof(struct ion_platform_heap), GFP_KERNEL); + if (!heap_data) + return -ENOMEM; heap_data->id = ION_HEAP_TYPE_FB; heap_data->type = ION_HEAP_TYPE_FB; @@ -294,6 +296,9 @@ int ion_drv_create_FB_heap(ion_phys_addr_t fb_base, size_t fb_size) heap_data->align = 0x1000; heap_data->priv = NULL; ion_drv_create_heap(heap_data); + + kfree(heap_data); + return 0; } |
