mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-11 05:17:10 +09:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user