fw: optimize the code that cause the mem leak.

PD#168987

Change-Id: Ie71c41778ef909c0c676d93d3e87e2644d935cdf
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
This commit is contained in:
Nanxin Qin
2018-07-12 14:03:21 +08:00
committed by Dongjin Kim
parent 9ceecdb7d1
commit ca44d65706

View File

@@ -647,7 +647,7 @@ static int fw_data_binding(void)
int ret = 0, magic = 0;
struct fw_mgr_s *mgr = g_mgr;
struct fw_files_s *files, *tmp;
char *buf = vmalloc(BUFF_SIZE);
char *buf = NULL;
int size;
if (list_empty(&mgr->files_head)) {
@@ -655,6 +655,7 @@ static int fw_data_binding(void)
return 0;
}
buf = vmalloc(BUFF_SIZE);
if (IS_ERR_OR_NULL(buf))
return -ENOMEM;