提交 a82d397b 编写于 作者: C Colin Ian King 提交者: Alex Deucher

drm/amd/powerplay: fix memory leak of tdp_table

tdp_table is being leaked on failed allocations of
hwmgr->dyn_state.cac_dtp_table. kfree tdp_table on the error
return path to fix the leak.
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 568d7c76
......@@ -512,8 +512,10 @@ static int get_cac_tdp_table(
hwmgr->dyn_state.cac_dtp_table = kzalloc(table_size, GFP_KERNEL);
if (NULL == hwmgr->dyn_state.cac_dtp_table)
if (NULL == hwmgr->dyn_state.cac_dtp_table) {
kfree(tdp_table);
return -ENOMEM;
}
memset(hwmgr->dyn_state.cac_dtp_table, 0x00, table_size);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册