From: Yuan Can yuancan@huawei.com
Offering: HULK ascend inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I5DS9S
------------------------------------------------------
create_spg_node() may fail with NULL pointer returened, and in the out_drop_spg_node path, the NULL pointer will be dereferenced in free_spg_node().
Signed-off-by: Yuan Can yuancan@huawei.com --- mm/share_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/share_pool.c b/mm/share_pool.c index 9c5b8e7fd6b7..e14753da004d 100644 --- a/mm/share_pool.c +++ b/mm/share_pool.c @@ -1523,7 +1523,7 @@ int mg_sp_group_add_task(int pid, unsigned long prot, int spg_id) if (unlikely(IS_ERR(node))) { up_write(&spg->rw_lock); ret = PTR_ERR(node); - goto out_drop_spg_node; + goto out_drop_group; }
ret = insert_spg_node(spg, node);