summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-03-14 16:14:59 +0800
committerAlex Deucher <alexander.deucher@amd.com>2018-03-15 09:55:46 -0500
commitfd06518d576ee3f0a51a9b1201f25608b774e60f (patch)
tree6ea885f199324b7bed4717e2ba4ad49a6683f4d5 /drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
parent116af45059139e8a156c9993bc4aa94625bd9c5e (diff)
downloadop-kernel-dev-fd06518d576ee3f0a51a9b1201f25608b774e60f.zip
op-kernel-dev-fd06518d576ee3f0a51a9b1201f25608b774e60f.tar.gz
drm/amd/pp: Fix memory leak in error path in smumgr
Free the backend structure if we fail to allocate device memory. Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
index 39d6f4e..26cca8c 100644
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c
@@ -229,8 +229,10 @@ static int tonga_smu_init(struct pp_hwmgr *hwmgr)
hwmgr->smu_backend = tonga_priv;
- if (smu7_init(hwmgr))
+ if (smu7_init(hwmgr)) {
+ kfree(tonga_priv);
return -EINVAL;
+ }
return 0;
}
OpenPOWER on IntegriCloud