From: Ding Tianhong dingtianhong@huawei.com
ascend inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I4M23J CVE: NA
-------------------------------------------------
Don't use the spa's va_start if the spa is not valid.
Signed-off-by: Ding Tianhong dingtianhong@huawei.com Reviewed-by: Weilong Chen chenweilong@huawei.com Reviewed-by: Hanjun Guo guohanjun@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com Reviewed-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- mm/share_pool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/mm/share_pool.c b/mm/share_pool.c index b209e216b33a..3a37418378f6 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -2508,13 +2508,14 @@ static void sp_alloc_finish(int result, struct sp_area *spa, sp_update_process_stat(current, true, spa);
/* this will free spa if mmap failed */ - if (spa && !IS_ERR(spa)) + if (spa && !IS_ERR(spa)) { __sp_area_drop(spa); + trace_sp_alloc_finish(ac, spa->va_start); + }
if (!is_pass_through) sp_group_drop(spg);
- trace_sp_alloc_finish(ac, spa->va_start); sp_dump_stack(); sp_try_to_compact(); }