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 --- 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 ea61f69cdd6ad..c9079e6a40b1a 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -2500,13 +2500,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(); }