From: Zhang Zekun zhangzekun11@huawei.com
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5LY2R CVE: NA
-------------------------------------------
Remove the meaningless comment in mg_sp_free() and the fix the bug in mg_sp_group_id_by_pid() parameter check path.
Signed-off-by: Zhang Zekun zhangzekun11@huawei.com --- mm/share_pool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/share_pool.c b/mm/share_pool.c index 6269702227f9..a8654ef0e784 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -1016,7 +1016,7 @@ int mg_sp_group_id_by_pid(int pid, int *spg_ids, int *num)
check_interrupt_context();
- if (!spg_ids || num <= 0) + if (!spg_ids || !num || *num <= 0) return -EINVAL;
ret = get_task(pid, &tsk); @@ -2179,7 +2179,6 @@ int mg_sp_free(unsigned long addr, int id)
sp_free_unmap_fallocate(fc.spa);
- /* current->mm == NULL: allow kthread */ if (current->mm == NULL) atomic64_sub(fc.spa->real_size, &kthread_stat.alloc_size); else