mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-27 01:11:31 +00:00
drm/amdgpu/powerplay/vega10: fix memory leak in error path
Free the backend structure if we fail to allocate device memory. Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
daf8809626
commit
a423f79ad7
1 changed files with 4 additions and 2 deletions
|
|
@ -406,9 +406,8 @@ static int vega10_smu_init(struct pp_hwmgr *hwmgr)
|
||||||
&handle,
|
&handle,
|
||||||
&mc_addr,
|
&mc_addr,
|
||||||
&kaddr);
|
&kaddr);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return -EINVAL;
|
goto free_backend;
|
||||||
|
|
||||||
priv->smu_tables.entry[PPTABLE].version = 0x01;
|
priv->smu_tables.entry[PPTABLE].version = 0x01;
|
||||||
priv->smu_tables.entry[PPTABLE].size = sizeof(PPTable_t);
|
priv->smu_tables.entry[PPTABLE].size = sizeof(PPTable_t);
|
||||||
|
|
@ -511,6 +510,9 @@ err0:
|
||||||
amdgpu_bo_free_kernel(&priv->smu_tables.entry[PPTABLE].handle,
|
amdgpu_bo_free_kernel(&priv->smu_tables.entry[PPTABLE].handle,
|
||||||
&priv->smu_tables.entry[PPTABLE].mc_addr,
|
&priv->smu_tables.entry[PPTABLE].mc_addr,
|
||||||
&priv->smu_tables.entry[PPTABLE].table);
|
&priv->smu_tables.entry[PPTABLE].table);
|
||||||
|
free_backend:
|
||||||
|
kfree(hwmgr->smu_backend);
|
||||||
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue