memory_ext: Coverity defect cleanup: memory_ext [1/1]

PD#SWPL-16531

Problem:
Coverity defect cleanup: memory_ext

Solution:
Modify code according to coverity

Verify:
verify on the board of U212

Change-Id: Ibfba4655938561071f40cd9cd78c7ec0d5c51194
Signed-off-by: changqing.gao <changqing.gao@amlogic.com>
This commit is contained in:
changqing.gao
2019-11-13 16:36:44 +08:00
committed by Luke Go
parent b71bdd47e6
commit 18b910673d
2 changed files with 3 additions and 2 deletions

View File

@@ -238,11 +238,13 @@ static struct page *get_migrate_page(struct page *page, unsigned long private,
next_node_in(page_to_nid(page),
node_online_map));
#ifdef CONFIG_AMLOGIC_PAGE_TRACE
#ifdef CONFIG_HUGETLB_PAGE
if (new) {
old_trace = find_page_base(page);
new_trace = find_page_base(new);
*new_trace = *old_trace;
}
#endif
#endif
return new;
}

View File

@@ -589,7 +589,6 @@ static void __init set_init_page_trace(struct page *page, int order, gfp_t flag)
text = (unsigned long)_text;
trace.ret_ip = (ip - text) >> 2;
WARN_ON(trace.ret_ip > IP_RANGE_MASK);
trace.migrate_type = gfpflags_to_migratetype(flag);
trace.order = order;
base = find_page_base(page);
@@ -1266,9 +1265,9 @@ int slab_trace_add_page(struct page *page, int order,
return 0;
nomem:
kfree(trace);
pr_err("%s, failed to trace obj %p for %s, trace:%p\n", __func__,
page_address(page), s->name, trace);
kfree(trace);
return -ENOMEM;
}